When we declare a variable as a pointer to a variable of type void, it is known as void pointer. Another name for it is generic pointer.
In general we cannot have a void type variable,but if the variable is of void type it do not point to any data and due to this it cannot be de-referenced.
These are the variables which remains visible throughout the program and are not recreated when they are recalled.
These types are by default initialised to zero and allocated memory on Data Segment.View wers in details
Variables prefixed with the keyword volatile acts as a data type qualifier. The volatile keyword attempts to alter the default way in which the variables are stored and the way the compiler handles the variables.
It is a kind of instruction to the optimizer to not to optimize the varabli during compilation.
When we create a pointer the memory to the pointer is allocated but the contents or value that memory has to hold remains untouched. Unitialised pointers are those pointers which do not hold any initial value.
Example: int *p; is said to be an unitialise pointer, it is recomended to initialise the pointer before actually using it as it an error.
Static is an access qualifier that limits the scope of the variable but causes the variable to exist for the lifetime of the program. This me a static variable is one that is not seen outside the function in which it is declared as its scopeis limited to the block of code in which it has been created but its lifespan remains until the program terminates.
The value of such a variable will remain and may be seen even after calls to a function also the declaration statement of such type of a variable inside a function is executed only once.
As we know that c allows us to make functions and cal them where ever needed, it prevents rework by calling the same function again and again where ever requires intead for example if we make a funtion that adds two numbers, it can be called anywhere in the program where ever the addintion is needed and we do not need to code again for adding any number.
It also shortens the length of the program as we do not need to code again the same thing for next time we can simple call the funtion and use it whenever needed.
Prototype of printf function is:
int printf( const char *format ,?)
In this the Second parameter: '?' (Three continuous dots) are known as called ellipsis which indicates the variable number of arguments.
Enumerated Data type helps the user in defining its own data type and also gives the user an opportunity to define what values this type can take.
The use of Enumerated Data Type maily lie when the program get more complicated or more number of programers are workin on it as it makes the program listings more readable.
These are the pointers that do not point to any object of appropriate type. These are special cases of memory vialation as they do not point to any appropraite type.These arises when some object is deleted from the memory or when an object is deallocated thus the pointer keeps on pointin to the memory location untill it is modified. Dangling pointers may lead to unpredictable results.
This keyword indicated that the function or the variable is implemented externally and it emphasizes that the variable ot the function exits external to the file or function.
We use this keyword when we want to make anything global in the project, it does not lie within any function.
The Preprocessor processes the source program before it is passed to the compiler. The features that preprocessor offers are known as Prepsocessor Directives.
Preprocessing directives are lines in your program that start with `#'. The `#' is followed by an identifier that is the directive name. For example, `#define' is the directive that defnes a macro. Whitespace is also allowed before and after the `#'. A preprocessing directive cannot be more than one line in normal circumstances. Some directive names require arguments.View wers in details
There are basically two differences between declaration and definition :
extern int x -> is a declaration whereas int y is definition.
To maintain the consistency between several files firstly place each definition in '.c' file than using external declarations put it in '.h' file after it is included .h file we can use it in several files using #include as it will be in one of the header files, thus to maintain the consistency we can make our own header file and include it where ever needed.
No, Union cannot be self referenced because it shares a single memory for all of its data members.View wers in details
A Trlation Unit is a set of source files that is seen by the compiler and it trlate it as one unit which is generally.file and all the header files mentioned in #include directives.
When a C preprocessor expands the source file with all the header files the result is the preprocessing trlation unit which when further processed trlates the preprocessing trlation unit into trlation unit, further with the help of this trlation unit compiler forms the object file and ultimately forms an executable program.
NULL pointer is not the unitialised pointer that can point anywhere, the NULL pointers are the one which do not point anywhere that is which do not point to any object or any function.
While handling real world problems we come across situations when we want to use different data type as one, C allows the user to define it own data type known as structures and unions.Structures and unions gathers together different atoms of informations that comprise a given entity.
When we declare identifiers within the same scope or in the different scopes they can be made to refer the same object or function with the help of likages.
There are three types of linkages:
EXternal Linkages me 'global, non-static' functions or variable.
Example: extern int a1
Internal Linkages me static variable and functions. Example: static int a2
None Linkages me local variables.
Example : int a3
The major disadvantage associated with the macro is :
When a macro is invoked no type checking is performed.Therefore it is important to declare a macro coreectly so that it gives a correct wer whenever it is called inside the program.