InterviewSolution
Saved Bookmarks
| 1. |
How will you print the address of a variable without using a pointer? |
|
Answer» We may acquire the address of any VARIABLE by USING the “address of operator” (&) operator, which yields the variable's address. #include <stdio.h>int main(void){ // declaring the VARIABLES int x; FLOAT y; char z; printf("Address of x: %p\n", &x); printf("Address of y: %p\n", &y); printf("Address of z: %p\n", &z); return 0;} |
|