Posts

Showing posts from February, 2013

Array

Image
Array : Difference between Array and Structure:                               Array                               Structure 1.       In array memory is static. We define the memory on declaration of array. 1.       In structure, memory is dynamic. 2.       It uses subscript to access elements. 2.       It uses Dot operator to access elements. 3.       Array is a base pointer and it points to base location 3.       Structure is not a pointer type. 4.       Array is collection of homogenous data. 4.       Structure is collection of heterogenous data. 5.       Array is derived data type. 5.       Structure is user defined data type. ·         In C languages, user can design a set of similar data types. When we need to store more than 1 value of similar data type, we use Array. ·         In c language, a simple variable can store only one value at a time. If we change the value, then pr

File Handling in "C"

Image
File handling Index 1.     Introduction 2.     File Operations 3.     Input Operations on File 4.     Output Operations on File 5.     Error handling 6.     Random access to Files 1.     Introduction             In Computer, when we run programs, they use memory (RAM) to store the variables, which are temporary. Memory is volatile and its content will be in memory till the program is running, once the program get terminated, then values stored in parameter also erased. If we need data again then we need to use keyboard input. So this will be valid for small data, but for large data it’s not possible to enter data again and again when you require it and another way to get the values may be generate the values pragmatically. But both of the ways are very difficult to implement.              So we need to store data on disk, which we can retrieve whenever we require. So here we are going to discuss how to store data on disk and perform various input and output operations. Note: