1.

Values char str1;char str2[1];Question What is the difference between the two variables declared above?​

Answer»

Declaration of a variable is for informing to the compiler the following information: NAME of the variable, type of value it holds and the initial value if any it TAKES. i.e., declaration gives DETAILS about the properties of a variable. Whereas, Definition of a variable says where the variable gets stored. i.e., memory for the variable is allocated during the definition of the variable. In C language definition and declaration for a variable takes place at the same time. i.e. there is no difference between declaration and definition. For example, consider the following declarationExplanation:



Discussion

No Comment Found