String Input and Output

String I/O includes fgets(), fputs()functions. Those functions we are going to discuss in this blog. fputs() This function is used to write any string into a file. After writing any string (or reading), the pointer will point to the next location. Below is the syntax for fputs function. fputs(“<string that we want to write>”,<file pointer…

Usage of Arrays

An array is said to be a collection of some data items, those all are of the same type and all can be accessed using one common name. We can say that an array is a group of multiple variables having the same data type, those differ from their index of the array. If one…

Random Access to File

Functions like fseek(), ftell() and rewind() are included in the “Random Access to file” topic. Those functions we are going to discuss in this blog. fprintf() This function is used to write multiple variables of multiple data types into a file. Suppose if we want to write an integer array and one float variable into…

Formatted Input and Output

Formatted I/O includes fprintf(), fscanf() functions. Those functions we are going to discuss in this blog. fprintf() This function is used to write multiple variables of multiple data types into a file. Suppose if we want to write an integer array and one float variable into a file then we can use this function. fprintf(<file…

Integer Input and Output

Integer I/O includes getw(), putw() functions. Those functions we are going to discuss in this blog. putw() This function is used to write any integer into a file. After writing any integer (or reading), the pointer will point to the next location. The syntax is written below. putw(<integer that we want to pass>,<file pointer name>);…

Character Input and Output

Character I/O includes getc(), putc(), fgetc(), fputc() functions. Those functions we are going to discuss in this blog. file pointer pointing any location Basically, the file pointer is a pointer to a structure and when it points to any location. It contains some information like file is being read/append/written, end of file reached or not,…

Usage of File

In this blog, we are going to learn how to make a file pointer and how to open and close a file using a file pointer. File pointer In each program where we are using file handling, we have to make a file pointer at the start of the program (before using any file operation)….

Introduction to File Data Type

Whatever programs we have done till now, those outputs were shown on screen. But that data was not stored in any secondary memory. This means those data were stored in primary memory, when we close the program then that data is permanently lost. We need some secondary memory storage to store data which is available…

malloc(), calloc(), realloc(), free()

Whichever memory that we have used till now was static memory. We can not change that memory while executing that program. But in some applications, we do not know how much memory we need. Let’s take an example to understand this. An array arr stores the roll number of students in class. Ex. int arr[50]; …

Pointer to Structure and Union

In this topic, we are going to learn the syntax and the use of pointers to structure and union. Pointer to structure and union is the same as a pointer to a simple variable. Working and purpose of structure and union will remain the same. When we want to store the address of a specific…