CS6202 / Programming and Data Structures I
CS6202 / Programming and Data Structures I
com
1. Define structure.
A structure is a user defined data type that groups logically related data items of different
data types into a single unit. All the elements of a structure are stored at contiguous
memory locations.
www.studentsfocus.com
www.studentsfocus.com
};
struct student
{
int rno;
char name[20];
struct dob date;
};
www.studentsfocus.com
www.studentsfocus.com
char name[20];
}s[15];
www.studentsfocus.com
www.studentsfocus.com
www.studentsfocus.com
www.studentsfocus.com
FILE *filepointer;
filepointer = fopen(filename,mode);
Example:
FILE *fp;
fp=fopen(hai.txt,r);
www.studentsfocus.com
www.studentsfocus.com
If a large amount of numerical data is to be stored, text files will be insufficient. In such
cases, binary files can be used.
Part B
www.studentsfocus.com