wat is the difference between a definition and declaration?
float y;---it looks like a declaration..but it s a
definition.how?someone explain
Answers were Sorted based on User's Feedback
Answer / kantilal
the diff b/w defination and declaration is
defination is allocating memory to the variable
ddeclaration is telling what type of variable it is and not
allocating memory for it
float y is defination as compiler allcates memory for it
if you give as extern float y it is declaration
| Is This Answer Correct ? | 30 Yes | 0 No |
Answer / vignesh1988i
this is declaration as well as definition....
according to me.,
DECLARATION here means that for some maniplation inside the
program we are going to use that variable y... but what is y
we want to tell the compiler so we are giving a new
DEFINITION to the alphabet as float DATA TYPE and thus we
are making the full variable
thank u
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / dally
defination is allocating memory to the variable.
but declaration is telling what type of variable it is and
not allocating memory for it.
Ex.int i;
extern int b;
here int i is definition because variable of value is
allocated in memory.
but variable b declared as int variable but memory is not
allocated for this.
float y is defination as compiler allcates memory for it
if you give as extern float y it is declaration
| Is This Answer Correct ? | 4 Yes | 0 No |
can we write a program in c for printf and scanf without using header file stdio.h
Write a program that receives as input a number omaadel-n-print, four digits.
Can you please explain the scope of static variables?
what is difference between array of characters and string
Why doesn't C support function overloading?
Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.
main() { printf("hello%d",print("QUARK test?")); }
can we print any string in c language without using semicolon(;)(terminator) in whole program.
#define min((a),(b)) ((a)<(b))?(a):(b) main() { int i=0,a[20],*ptr; ptr=a; while(min(ptr++,&a[9])<&a[8]) i=i+1; printf("i=%d\n",i);}
What functions are in conio h?
find the size of structure without using the size of function
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays