Computer Science, asked by mehena4, 1 year ago

In C program what does &i indictes

Answers

Answered by Programme
2

& symbol serves two purposes in C programming. It is a addressOf operator i.e. used to retrieve memory location of a variable.

Example :

int a =10;

printf(“%d”,a); //value 10 will be printed

Here the variable’s value 10 will be obtained as a output. Now what if we want to the memory location where the variable is stored? It will be done as follows:

printf(“%d”&a); // Address of a

Secondly, it is a bit-wise operator. Bit-wise operators are used when we want to work on the bits directly. Unlike, relational and logical operators that return 1 and 0 these operators returns binary number like 1101010 .

Answered by Anonymous
1
I tried a code to see what is the difference between &i and i if i is an array. My assumption was that i represents the starting address of the array, and I had no idea what will happen if I print &i as well. The result was surprising, as both i and &i was the starting address of the array.
Similar questions