Click here to Skip to main content
15,911,762 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General* versus ** Pin
verbatin6-Dec-02 23:28
verbatin6-Dec-02 23:28 
GeneralRe: * versus ** Pin
Christian Graus7-Dec-02 0:20
protectorChristian Graus7-Dec-02 0:20 
GeneralRe: * versus ** Pin
verbatin7-Dec-02 4:10
verbatin7-Dec-02 4:10 
GeneralRe: * versus ** Pin
Anonymous7-Dec-02 0:34
Anonymous7-Dec-02 0:34 
GeneralRe: * versus ** Pin
Nitron7-Dec-02 4:46
Nitron7-Dec-02 4:46 
GeneralRe: * versus ** Pin
Alvaro Mendez7-Dec-02 9:28
Alvaro Mendez7-Dec-02 9:28 
GeneralRe: * versus ** Pin
Nitron7-Dec-02 12:27
Nitron7-Dec-02 12:27 
GeneralRe: * versus ** Pin
verbatin10-Dec-02 16:13
verbatin10-Dec-02 16:13 
Now hold on a second.
You said:

int x = 5; // initializes a variable int to value
int* px = &x; // initializes a "pointer to int"

But that's not exactly true.


int x;
int *y = x;

Now y holds the physical address for x - the dereference "&" is contradictory. To dereference, LATER ON, you could say &y. So if you said:

int* y = &x;

You would actually get a compilation error because you're trying to assign a memory location to an integer variable. The & character dereferences a variable and that's why you see variables being passed as parameters to functions like so:

void mod(int &x, int &y)
{ x=x%y return;}

This actually changes the value of the memory location at x without having to return the value at the end of the function.


GeneralRe: * versus ** Pin
Nitron11-Dec-02 5:02
Nitron11-Dec-02 5:02 
GeneralRe: * versus ** Pin
Nitron11-Dec-02 5:06
Nitron11-Dec-02 5:06 
GeneralCannot download so big a Microsoft SDK, for programming GDI+ Pin
Phan Manh Dan6-Dec-02 22:09
Phan Manh Dan6-Dec-02 22:09 
GeneralRe: Cannot download so big a Microsoft SDK, for programming GDI+ Pin
Christian Graus6-Dec-02 22:39
protectorChristian Graus6-Dec-02 22:39 
GeneralRe: Cannot download so big a Microsoft SDK, for programming GDI+ Pin
Jeff Patterson7-Dec-02 11:44
Jeff Patterson7-Dec-02 11:44 
GeneralChange tooltip for close button ... Pin
Neha6-Dec-02 21:09
Neha6-Dec-02 21:09 
GeneralRe: Folder Security Pin
Mazdak7-Dec-02 7:49
Mazdak7-Dec-02 7:49 
GeneralRookie Pin
hassani6-Dec-02 19:52
hassani6-Dec-02 19:52 
GeneralRe: Rookie Pin
Michael Dunn6-Dec-02 20:22
sitebuilderMichael Dunn6-Dec-02 20:22 
GeneralRe: Rookie Pin
Christian Graus6-Dec-02 20:23
protectorChristian Graus6-Dec-02 20:23 
GeneralRe: Rookie Pin
Michael Dunn6-Dec-02 20:28
sitebuilderMichael Dunn6-Dec-02 20:28 
GeneralRe: Rookie Pin
Christian Graus6-Dec-02 20:30
protectorChristian Graus6-Dec-02 20:30 
GeneralRe: Rookie Pin
Michael Dunn6-Dec-02 20:34
sitebuilderMichael Dunn6-Dec-02 20:34 
GeneralRe: Rookie Pin
Christian Graus6-Dec-02 20:41
protectorChristian Graus6-Dec-02 20:41 
GeneralRe: Rookie Pin
KaЯl7-Dec-02 1:53
KaЯl7-Dec-02 1:53 
GeneralRe: Rookie Pin
Christian Graus6-Dec-02 20:22
protectorChristian Graus6-Dec-02 20:22 
GeneralRe: Rookie Pin
Alvaro Mendez7-Dec-02 9:26
Alvaro Mendez7-Dec-02 9:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.