what is the difference between declaration ,defenetion and
initialization of a variable?
Answer Posted / gg
As i know.....
Definition is one which allocates memory.
Ex: int x;
Declaration never occupy any memory space.
Ex:Function prototype declarations such as....
int func(int,int);
Initialization: If any variable assigned with some value at
time definition itself is called initialization.
Ex:int x=0;
| Is This Answer Correct ? | 35 Yes | 7 No |
Post New Answer View All Answers
Why can’t we compare structures?
Is it valid to address one element beyond the end of an array?
What is the purpose of macro in C language?
How does placing some code lines between the comment symbol help in debugging the code?
Why array is used in c?
Explain how do you override a defined macro?
What is the argument of a function in c?
What is memory leak in c?
What is variable declaration and definition in c?
Write a program to reverse a linked list in c.
What is the sizeof () operator?
Why header files are used?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
What is %d used for?
When can you use a pointer with a function?