Here you will get program and learn how to generate random number in C and C++. We can use rand() function to generate random number. It is defined in stdlib.h header file. It generates a random number between 0 and RAND_MAX (both inclusive). Here RAND_MAX is a constant whose value depends upon the compiler you are… Read More »
In this article you will get list of format specifiers in C. Format specifier is used to specify the data type while reading or writing. For example if you want to print value of an integer type variable then you have to use %d in printf() function. Take below example.
As you can… Read More »
Here you will learn about dangling reference and dangling pointer in C. In computer programming, memory is allocated for holding data object. After the work is done the memory is deallocated so that this memory can be used to store any other data object. Also Read: void pointer in C What is Dangling Pointer? While programming,… Read More »
In this tutorial you will learn about difference between break and continue in C. The break statement is used in switch or loops and continue statement is used only in loops. When break statement is encountered it immediately stops the switch or loop execution. When continue statement is encountered, all the statements next to it are skipped… Read More »
Here you will learn about difference between call by value and call by reference in C. There are two different ways of passing values to functions: call by value and call by reference. They are also called as pass by value and pass by reference. Call by Value in C In call by value method… Read More »
In this article I will tell you how to run C and C++ program in CMD. CMD or Command Prompt is a command line interpreter in Windows operating system. Running C and C++ programs using command prompt is useful in case you don’t have an IDE installed in your system. Also Read: Configure Notepad++ to Run… Read More »
In this tutorial you will learn about difference between C and C++ language i.e. C vs. C++. C programming language was developed by Dennis Ritchie in the year 1972 while C++ programming language was developed by Bjarne Stroustrup in the year 1983. C++ is a superset of C and contains all the features of C language. Still there… Read More »
In this tutorial you will learn about difference between structure and union. Structure and union both are user defined data types which contains variables of different data types. Both of them have same syntax for definition, declaration of variables and for accessing members. Still there are many difference between structure and union. In this tutorial we will take… Read More »
Union is a user defined data type which contains variables of different data types. Or we can say that, union is collection of dissimilar type of elements or data. The concept of union is taken from structure so the syntax of union is same as structure. Union can be defined using keyword “union” as shown… Read More »
C Enumeration or Enumerated Data Type C enumeration is a user defined data type which consists of a list of names and each name corresponds to an integral constant. It increases the program readability as names are easy to read and maintain. Enumerated data type can be defined in C using “enum” keyword. The syntax… Read More »
We declare a pointer to integer, pointer to character or pointer to array. Similarly we can declare a pointer to function or a function pointer. Same as like variables, functions also have some address in memory. C Function Pointer A function pointer is a pointer that contains the address of a function. It can be… Read More »
When we declare a pointer we specify its type which will be same as the type of the variable whose address the pointer will contain. For example if we will declare an integer pointer then it can contain the address of an integer variable only. Take below example.
p=&b; //invalid, will show an error because p can contain address of integer type variable only
What if we can have a… Read More »