Miscellaneous > Programming & Networking
Why does it give me the addy location?
Bazoukas:
int main() {
int val;
int str[1]={1};
int *p1;
p1=str;
cout<<str;//tried with p1 same thing
return 0;
}
0xbffff9f0 this is what i get. I thought it takes the 1st value of the array. Me is confused.
Bazoukas:
its official. i am TUPID.
cout<<str[0];
voidmain:
Or this:
--- Code: ---
--- End code ---
[ November 19, 2002: Message edited by: void main ]
Bazoukas:
hmm you way seems to be more sufficient in a large array. I will toy around with it now that I saw what i was missing.
Its kinda confusing till you get the hang of it.
voidmain:
I'm not sure what you are doing but what I posted as an example is not something I personally would do (I don't believe anyway without knowing what you are working on). I just put it in the syntax that would work like I thought *you* wanted it to.
[ November 19, 2002: Message edited by: void main ]
Navigation
[0] Message Index
[#] Next page
Go to full version