In C, explain the difference between the & operator and the * operator?

Submitted by: Administrator
& is the address operator, and it creates pointer values.
* is the indirection operator, and it preferences pointers to access the object pointed to.

In the following example, the pointer ip is assigned the address of variable i (&i). After that assignment, the expression *ip refers to the same object denoted by i:

int i, j, *ip;
ip = &i;
i = 22;
j = *ip; /* j now has the value 22 */
*ip = 17; /* i now has the value 17 */
Submitted by: Administrator

Read Online Electrical Engineering Job Interview Questions And Answers