Breaking

शुक्रवार, 3 अप्रैल 2020

BCA 2nd Sem Notes- Nested structures in C

  • UNIT-I (Array)
Definition
Declaration & initialization of 1D 
Accessing array elements
Displaying array elements
Sorting arrays
Arrays and function
Declaration & initialization of 1D
Accessing and Displaying
Memory representation of array [Row Major, Column Major]
Multidimensional array



  • UNIT-II (Pointers)
  • Definition

    Declaration & initialization
    Indirection operator
    address of operator
    pointer arithmetic
    dynamic memory allocation
    arrays and pointers
    function and pointers




  • UNIT-III (Strings)

  •   strlen(),strcpy(),       strcat() ,strcmp()



  • UNIT-IV (Structures)
  • Definition



  • UNIT-V                                     (C Pre-processor)




  • UNIT-VI                                (File Handling)


  • Definition of Files,
    Opening modes of files
    Standard function
    fopen(), fclose(),             feof()  fseek(),                    fewind()
    Using text files
    fgetc(), fputc(), fscanf()

    Nested structures


    Structure written inside another structure is called the nesting of two structures. Structure members are accessed using the [.]dot operator.

    The syntax for structure within a structure or nested structure

                  struct structure1
                  {
                         - - - - - - - - - -
                         - - - - - - - - - -
                  };
    
                  struct structure2
                  {
                         - - - - - - - - - -
                         - - - - - - - - - -
                         struct structure1 obj;
                  };

    There are two types of structure used in a nested structure

    1. By separate structure
    2. By Embedded structure

    1. Separate structure
    In a separate structure, we can create one or more structures inside the main structure as a member.
    Syntax:

    1. Embedded structure:
    The embedded structure can be created within the structure. Let us consider how to declare the embedded structure.
    Syntax:
    Example
    Write a program of Nested structure in C language.
    Output

     Previous Page  Print Page
    Next Page  
    Advertisements

    कोई टिप्पणी नहीं:

    एक टिप्पणी भेजें