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 |
Write a program to find given number is even or odd without using any control statement.
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is the difference between variable declaration and variable definition in c?
What does c value mean?
with out using main how to execute the program?
int i; i=2; i++; if(i=4) { printf(i=4); } else { printf(i=3); } output of the program ?
void main() {int a[5],i,b=16; for(i=0;i<5;i++) a[i]=2*i; f(a,5,b); for(i=0;i<5;i++) printf("\n %d",a[i]); printf("\n %d",b); } f(int *x,int n,int y) { int i; for(i=0;i<n;i++) *(x+i)+=2; y=y+2; }wat r the errors in the prg.and improvise the prg to get o/p.?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed.
2 Answers Scientific Atlanta, Wipro,
What is pointer to pointer in c with example?
Explain low-order bytes.
What does sizeof return c?