pointers jinsoft

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

Posted on 1 CommentPosted 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.

loops in C

C series for 1st sem students: Conditionals and loops

Posted on 2 CommentsPosted in Blogs, Technology

Today we are going to discuss about conditionals and loops in programming in general and the syntax of them in C. Conditional statements are those which check the validity of a statement, by implementing logical operations in the CPU and returns a true or false(1 or 0). In C language we do not have the boolean datatype or the values ‘true’ and ‘false’. Here 1 represents true and 0 false. In the hardware, a certain bit in a register (also called flag) is set or unset (a 1 or 0) after the logical operation is performed. This bit is then checked, and depending upon its value the subsequent lines of code are executed.

digital clock in C

C series for 1st sem students: Lets code a digital clock in C

Posted on Posted in Blogs, Technology

We will code a digital clock in C. Learning a programming language is useless if you can’t make cool applications with it. Building such things are way easier in modern languages like C#, java or javascript. But with a good understanding of the basic programming concepts, and using some library functions provided in various header files, we can make some really cool apps.

variable in C

C series for 1st sem students: variable, datatypes and macros

Posted on Posted in Blogs, Technology

Variable is a container to hold data. Datatype of a variable defines the type of data to be stored and the space required to store it. Variables in programming are analogous to variables in algebra. Just as algebraic expressions can have constant terms like ax + by = c , C programs can have constants, defined similar to variables but with the const keyword.