Stop Microsoft
Miscellaneous => Programming & Networking => Topic started by: Bazoukas on 19 November 2002, 08:44
-
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.
-
its official. i am TUPID.
cout<<str[0];
-
Or this:
[ November 19, 2002: Message edited by: void main ]
-
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.
-
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 ]
-
oh yeah sorry bout that.
I was trying to display the element of the array which in my case is one. I am trying to get the hang of arrays and pointers.
From the little i played around with, i can tell you can do some nifty things.With ++ -- operators. Am guessing it saves you from alot of for loops.
Am still trying to figure out what it can do.
Cool stuff :D
-
You mean something like this?
[ November 19, 2002: Message edited by: void main ]
-
yep. but there things here in the books that just make my head spin. delete - indexing- multiple inderections.....this is the 1st time am doing pointers seriously (cause of school) and my head spins right now. Too much info to go around my small head :eek:
But I can tell i will love pointers. They seem to be much flexible
-
Yeah, pointers can be a bitch to learn. Don't ask me to teach you. (http://smile.gif)
-
THats it then. No lesbian stripers for your birthday. (http://tongue.gif)
[ November 19, 2002: Message edited by: bazoukas ]
-
Im going to learn these properly one day... now i know not to ask MainVoid
-
Its not that hard, and its not that easy either. You just have to approach it with confidence and humility and take it step by step.
In two and a half weeks we will be on vacations so I will publish in my web site that freaking tutorial that i wanted to do for so long.
Here is a half ass job that I did like a year ago when I was doing C++ on my own free time.
Yes i know its made with frontpage. I was an MS ho then so forgive.
I covered from intro all the way to selection structures. You can learn these in matter of few days if not less than that. (http://geocities.com/ellhnas25)
The link on the bottom of the home page leads you to a stupid forum that I used to visit. Actually it was the very 1st forum I posted in. It filled with a bunch of fucking cry babies. So dont bother.
[ November 20, 2002: Message edited by: bazoukas ]
[ November 20, 2002: Message edited by: bazoukas ]