Object files are compiled code modules useful to split large code files into small modules to enable to manage them easily. In this article, we are going to discuss the steps to create object files and use them from other code modules. When we compile a program, the ‘C’ compiler will generate object files (“.o” […]
C Programming – Using bitwise operators
‘C’ provides bitwise operators to deal with bits. Each bit is either “0” or “1”. In this article we are going to discuss how to use bitwise operators in ‘C’. ‘C’ provides the following bitwise operators. & (Ampersand – Bitwise AND Operator) | (Pipe Symbol – Bitwise OR Operator) ^ (Cap Symbol – Bitwise XOR […]
C Programming – Dealing with files – How to use open function to open a file?
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; “C Programming – Dealing with files – How to read from a file?“, “C Programming – Dealing with files – How to write to the file?” and “C Programming – Dealing […]
C Programming – Dealing with files – How to fetch a record from the file?
In our previous article, we have used “getrecord” function. We will start this article with this function. We have to implement “getrecord” to fetch a record from the “employee.dat” file. It will check the “employee.dat” file for an employee record based on the given employee number. If it finds the employee record it will return […]
C Programming – Dealing with files – How to write to the file?
We have discussed opening & reading from the file in our previous Article “C Programming – Dealing with files – How to read from a file?“. fwrite function 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 […]
C Programming – Dealing with files – How to read from a file?
C library provides good number of file handling functions to deal with files and directories / folders. Generally we can classify these functions as: Buffered functions and Un-buffered functions. Un-buffered functions are the raw functions deals directly with storage devices. Whereas, buffered functions maintains memory buffers to improve the performance and reduce the number of […]