Hi, I am getting into pointer and linked lists now!
Here is my question,
If I am reading this chapter right, this just allocates memory it does not initialize memory, am I right???Code:int *x;
int *y = new int;
Thanks!!!
Printable View
Hi, I am getting into pointer and linked lists now!
Here is my question,
If I am reading this chapter right, this just allocates memory it does not initialize memory, am I right???Code:int *x;
int *y = new int;
Thanks!!!
yea thats right... the memory you allocated might hold some junk value..
>am I right???
You are indeed. Or to be more precise, x is uninitialized and points to nothing usable and y points to enough memory for an integer.
>"char" by default is signed, right?
No, char could be either signed or unsigned by default.
> "char" by default is signed, right?
You don't listen very well do you?
http://cboard.cprogramming.com/showt...igned+unsigned
>You don't listen very well do you?
No, I just think he fills his brain up with all kinds of trivia and then forgets. ;)
I'd be surprised if he's written a single program yet, I think he's skipping that part and going straight to the "I'm gonna write a programming encyclopedia" part. No offense C++Forever.
>I think he's skipping that part and going straight to the "I'm gonna write a programming encyclopedia" part.
He's doing such a good job of picking my brain it's either that or he's testing us here at Cprogramming to see what we know. ;)