C file operations

C series for 1st sem students: File System Manipulation

Posted on Posted in Blogs, Technology

Today we are going to discuss FILE SYSTEM operations using the C language. Till now we have worked with the RAM for storing our variables and our data. But the RAM is not persistent. We need to store data permanently. So we store them in permanent memory like hard disks or CDs/DVDs, in files. Different types of data are stored in different type of files, but for our purposes we’ll work with text files in windows system which have an extension of ‘.txt‘.

union enum

C series for 1st sem students: Lesser taught constructs, Unions & Enums

Posted on Posted in Blogs, Technology

Today we’re going to discuss two topics which are rarely taught in a C programming college course, Unions & Enums. One may justify that by saying they are not absolutely necessary for basic knowledge in programming, or that these topics are rarely asked in interviews. But if you become a professional C developer, you’ll have extensive use of them. These are particularly useful in low level programming, like with embedded systems and robotics.

pointers jinsoft

C series for 1st sem students: Pointers as array arguments

Posted on Posted in Blogs, Technology

Pointers are used extensively in array operations. The name of the array is actually a reference to the address of the first element, rather than the actual array. Thus the array name is a pointer. So when we pass an array as an argument to a function, we are not actually passing a copy of the array (as we do in case of a variable), but we are passing a copy of the pointer to the first element of that array. This is the “pass by reference” hack that we discussed earlier.

C series for 1st sem students: Pointers in strings and scanf

Posted on Posted in Blogs, Technology

To be able to reap the best benefits from pointers, you’ll have to have a deep understanding of them. This blog is going to be very conceptual and we might not be writing real-world value code here, but these program snippets will help you use pointers in a very productive and efficient manner in future. We’ll discuss two use cases of pointers that we generally overlook: strings and the scanf function.

C series for 1st sem students: Pointers in function calls

Posted on Posted in Blogs, Technology

C is a procedural language, which means it follows a series of steps/procedures in a systematic order to solve a problem. These procedures are often organized in functions. These functions take in some value(s) as argument(s), operate on them and return an output. But apart from this approach, a function can even change the state of other variables in the global scope, perform input/output operations etc.