Category: C Programming

C Programming: Using bitwise operators

‘C’ provides bitwise operators to deal with bits. Each bit is either “0” or “1”. In this article I am going to explain how to use bitwise operators in ‘C’. ‘C’ provides the following bitwise operators. & (Ampersand – Bitwise…

C Programming: Dealing with files (Part – 6)

We have discussed some of buffered and un-buffered functions those are dealing with file management in ‘C’. In this article I am going to discuss couple of other ‘C’ functions used for file management. Like fseek function we have lseek function which…

C Programming: Dealing with files (Part – 5)

As part of this series of articles, we are discussing about buffered and un-buffered functions dealing with file management. We already discussed about buffered functions in our previous articles; and started discussing on un-buffered functions. We have seen open and…

C Programming: How to use bit fields in structures?

‘C’ structures are used to group multiple variables of same or different types. The variables inside the structures can be accessible through its structure variable. ‘C’ structures are useful to maintain related information. ‘C’ allocates memory for each variable mentioned…

C Programming: Dealing with files (Part – 4)

We have discussed that ‘C’ provides buffered and un-buffered functions for file management. We have already discussed some of the buffered functions in our previous articles. In this article, we will look into some of the un-buffered functions ‘C’ provides…

C Programming: Dealing with files (Part – 3)

In our previous article, we have used “getrecord” function. We will start this article with thisfunction. We have to implement “getrecord” to fetch a record from “employee.dat” file. It will check the “employee.dat” file for an employee record based on the given…

C Programming: Dealing with files (Part – 2)

Another important buffered function ‘C’ provides is fwrite function. fwrite function writes to the file. The file should be opened with fopen function call. The syntax of this fwrite function is: size_t fwrite(const void *ptr, size_t size, size_t ntimes, FILE…

C Programming: Dealing with files (Part – 1)

‘C’ Programming provides good number of file handling functions to deal with files and directories or folders. Generally we can classify these functions as: Buffered functions and Un-buffered functions. Un-buffered functions are the raw function deal directly with storage devices.…

C Programming: Dynamic memory allocation

‘C’ Programming provides functions to create and release memory dynamically. There are two types of functions ‘C’ provides: One type of functions allocates memory in the heap. malloc calloc realloc Other type of function(s) release the memory from the heap.…