Posted by Ray on Sunday, July 8, 2012 at 2:18pm.
how do the following statements differ
and what does int **a mean
- computer - Steve, Sunday, July 8, 2012 at 2:50pm
1) p points to a
2) the address of a is stored where p is pointing
3) p points to memory address 1
4) prints the address stored in p
5) prints the integer pointed to by p
- computer - Nazim, Friday, July 13, 2012 at 9:08am
Hello Ray :)
(Sorry if i have a bad English)
- int a = 1 : You declared an integer variable, (imagine that is a box that contain the value 1 : .
-int *p : You declared a pointer of integer . When we declare a pointer we need to put * before the variable . But * have an other meaning, when we use the pointers :
Imgine that p is an arrow that indicate integer boxes ->[int ?]. p will contain the address of the box, and *p allows us to see what's in the box .
1] Imagine that we give to "p" the address of "a", than the pointer p "->" will move and stuck to the box "a" like this : ->[ 1] "
2]we put into the box that was pointed by "p ->[?int]" the location of a . ( useless :) )
3] p will point to another memory slot, and we give to him an other box  (in these case it will change nothing :) : p will point the same box "a" )
And like Steve said :
4] prints the address stored in p
5] prints the integer pointed to by p
Answer this Question
More Related Questions
- Computer - on C++, I want to make an operation like " 2x + y - z ", I wrote ...
- c++ program - how can a modfiy this source code to a menu. #include <stdio.h&...
- C Programming - I am trying to find the sum of two integers. I entered the ...
- C programming - Enter two integers between 1 to 10 3 4 Both numbers are less ...
- computer sciece - #include <stdio.h> #include <stdlib.h> int main...
- computer - Which of the following does not print the numbers from I to 10? A) ...
- C Programming - Write a C program that accepts sales made by 5 sales reps for ...
- programming - Having trouble with this program running, can anybody help solve ...
- C programming - Question: Write a program that reads integers from the keyboard ...
- Computer Science - //program that puts two lists in order in one single list ...