Error handling

Error handling In C Programming File Handling Error Management, particular file errors occurring during file operation in a C program are managed and controlled. Error management detects errors occurring during file operation. Many times, while opening a file, we can manage the errors of failures in file open, read, write, append operations. So let's understand…

Comments Off on Error handling

Sequential and random file access

Sequential and random file access In file handling operation in C programming, any file access can be divided into two types. Which includes sequential file access and random file access methods. So, let's know both sequential access and random file access methods in file handling in detail in the file program example below. Sequential Access…

Comments Off on Sequential and random file access

File operations (opening, closing, reading, writing)

File operations (opening, closing, reading, writing) File handling in C programming is used for various file operation tasks in C program. By file operation, you can perform file operation tasks like open, close, read, write, etc. in C program. Where you access the file operation function from standard input/output library I/O (stdio.h) header file in…

Comments Off on File operations (opening, closing, reading, writing)

Union in c language

Union in c Union is a user defined data type member in C programming. Which specifically stores different data types program variables elements in the same memory storage location. In union C structure where each structure member has its own individual memory storage location. All variable members of the same union data type use the…

Comments Off on Union in c language

Structure pointers

Structure pointers Using pointer operators for structure data type members allows you to efficiently manipulate structure data type members within the declared structure and to access structure members from memory address locations, especially when dynamic memory allocation is needed for a structure or passing a function to a structure. So let's use structure to pointer…

Comments Off on Structure pointers

Nested structures in c

Nested structures in c Nested Structure In C programming, when we declare another sub-structure in a structure. Those which are declared as another structure member inside a structure. They are called nested structure data type. Whenever you define new other types of structure members as data type inside another structure. Nested structures help you to…

Comments Off on Nested structures in c

Accessing structure members

Accessing structure members If you want to access the structure members individually in the C program, then you can use the dot (.) operator in the structure to work directly with the declared structure variable. Similarly, when you use pointers in the structure, you call the structure members using the arrow (->) operator. So let's…

Comments Off on Accessing structure members

Structure Declaration and definition

Structure Declaration and definition Use of Structure Data Type (Structure) Members In C Programming, different types of program data type variables are grouped together and processed under a single structure member name. Structures in C language provide you the features to create and process complex data type programs. Remember that any C program structure can…

Comments Off on Structure Declaration and definition

Character arrays vs. string literals

Character arrays vs. string literals Character arrays and string literals are used in C programming to fulfill different programming tasks, and they have different string array properties. Especially they are used to solve some specific string operations. Character array declaration in C. Character array declaration and initialization. char text[50]; // 50 Character array declaration named…

Comments Off on Character arrays vs. string literals

String manipulation functions (strcpy, strcat, strlen, etc.)

String manipulation functions (strcpy, strcat, strlen, etc.) String Manipulation Built-in string functions are used in C programming language to perform various types of string operations on string text or paragraphs. You can apply many string operations in C program by declaring character string as array such as copying a string, joining two different strings, comparing…

Comments Off on String manipulation functions (strcpy, strcat, strlen, etc.)