Breaking

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

BCA-2nd Sem Notes - structure operations

  • 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()

     structure operations 

    To access any member of a structure, we use the member access operator (.). The member access operator is coded as a period between the structure variable name and the structure member that we wish to access. You would use the keyword struct to define variables of structure type. 

    1. Array elements are accessed using the Subscript variable, Similarly, Structure members are
    accessed using dot [.] operator.
    2. (.) is called as “Structure member Operator”.
    3. Use this Operator in-between “Structure name” & “member name”
    Example
    #include <stdio.h>
      
    struct Point {
      int x;
      int y;
    };
      
    int main()
    {
      struct Point p1 = {10, 20};
      struct Point p2 = p1; // works: contents of p1 are copied to p2
      printf(" p2.x = %d, p2.y = %d", p2.x, p2.y);
      getchar();
      return 0;
    }


     Previous Page                                          Print Page
    Next Page  

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

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