C Articles

Page 29 of 96

What are the different computer languages?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 936 Views

Programming languages are used to give instructions to the computer in a language which a computer can understand. They serve as a bridge between human logic and machine execution. Computer languages are classified into three types as follows − Machine languages Symbolic languages High level languages Computer Language Types Machine Language Binary Code 1010 1100 0011 Assembly Language Mnemonics MOV, ADD, JMP ...

Read More

Differentiate the NULL pointer with Void pointer in C language

Sindhura Repala
Sindhura Repala
Updated on 15-Mar-2026 13K+ Views

In C programming, NULL pointers and void pointers are two distinct concepts that serve different purposes. A NULL pointer represents a pointer that doesn't point to any valid memory location, while a void pointer is a generic pointer type that can point to any data type but requires type casting for dereferencing. Syntax /* NULL Pointer */ data_type *pointer_name = NULL; /* Void Pointer */ void *pointer_name; NULL Pointer A NULL pointer is a pointer that doesn't point to any valid memory location. It's used to indicate that the pointer is not currently ...

Read More

What happens if we include header file for two times in a C program?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 1K+ Views

In C programming, header files contain declarations of predefined functions, constants, and macros. When a header file is included multiple times in a program, the preprocessor automatically handles this situation to prevent compilation errors. What Happens with Duplicate Includes? When a header file is included twice or more times in a C program, the C preprocessor uses include guards (or header guards) to ensure that the contents of the header file are processed only once during compilation. Most standard C library headers like stdio.h, stdlib.h, etc., have built-in protection mechanisms. How Include Guards Work Standard header ...

Read More

What are the different searching techniques in C language?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 11K+ Views

Searching techniques in C refer to algorithms used to find a specific element (key) within a collection of data. These techniques are fundamental in computer programming and data structures. Successful search − The key element is found in the list Unsuccessful search − The key element is not present in the list C language provides two primary searching techniques − Linear Search − Sequential search through elements Binary Search − Divide-and-conquer approach for sorted arrays Linear Search Linear search is the simplest searching algorithm that checks each element sequentially until the ...

Read More

Explain the sorting techniques in C language

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 45K+ Views

In this article, we are going to learn about the different sorting techniques and their implementations in C language. Sorting in C programming requires rearranging elements in the array into a determined order, i.e., in ascending or descending order. This uses comparison operators to specify the new order of a list or array. This is widely used in different applications that include searching algorithms, data structure optimization, and database management. Types of Sorting Techniques The following are the main sorting techniques that we can implement in C language − Bubble Sort ...

Read More

C Program for copying the contents of one file into another file

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 23K+ Views

File copying is a fundamental file operation in C programming that involves reading data from one file and writing it to another file. This process requires proper file handling using standard C library functions for opening, reading, writing, and closing files. Syntax FILE *fopen(const char *filename, const char *mode); int fgetc(FILE *stream); int fputc(int character, FILE *stream); int fclose(FILE *stream); Parameters filename − Path to the file to be opened mode − File access mode ("r" for reading, "w" for writing) stream − Pointer to FILE object character − Character to be written ...

Read More

What are the text files and binary files in C language?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 16K+ Views

A file is a collection of data stored in secondary memory, used for storing information that can be processed. Files allow data to be saved and retrieved later. They can store both programs and data, making file input and output operations crucial for reading from and writing to files. There are two types of files in C language which are as follows − Text file Binary File Text File Text files contain alphabets and numbers that are easily understood by humans. Errors in text files can ...

Read More

Why files are needed in C programming language?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 4K+ Views

Files are collections of records or storage locations on hard disk where data is stored permanently. In C programming, files allow programs to store and retrieve data that persists beyond program execution. We can access files using various C library functions for different operations. Need of Files in C Programming Files are essential in C programming for the following reasons − Data Persistence: Entire data is lost when the program terminates. Storing data in files preserves your information even after the program ends. Time Efficiency: If you need to enter large amounts of data, it normally ...

Read More

Write a structure in local scope program using C language

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 511 Views

A structure in C is a collection of different datatype variables, grouped together under a single name. When a structure is declared inside a function or block, it has local scope and can only be accessed within that specific function or block. Syntax struct structure_name { datatype member1; datatype member2; datatype member_n; }; Local Scope Structure Declaration When a structure is declared inside a function, it is local to that function and cannot be accessed from outside − void function() ...

Read More

Explain the concept of Uninitialized array accessing in C language

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 1K+ Views

In C programming, accessing an uninitialized array can lead to unpredictable behavior since the array elements contain garbage values from memory. Understanding this concept is crucial for writing reliable C programs. Syntax int array[size]; // Uninitialized array int array[size] = {0}; // Initialized with zeros int array[size] = {1, 2, 3}; // Partially initialized Key Behavior Uninitialized arrays contain garbage values from memory locations The compiler does not generate compilation or runtime errors for accessing uninitialized arrays Values are ...

Read More
Showing 281–290 of 953 articles
« Prev 1 27 28 29 30 31 96 Next »
Advertisements