June 28th, 2013, 10:27 PM
[RESOLVED] *char user input
gragh! this should be simple! >.< I thought I had a good understanding of this by now.. guess I don't
basicly I want to do this:
only have the user input it.
char * name = "bob";
I must have tried a million different variations, different codes, jumping from different pointers, converting from strings, specifying specific char lengths, you name it, yet I either get an "not initialized" error (though isn't the cin initializing it? even so, even if I initialize it before the cin, I still get that error) or I get the pointer to the name the user entered, and the code I borrowed off someone else doesn't seem to take that because.. they seem they want the pointer to be the char, not a pointer to the char :s all I know is that the first example works beautifully, but as soon as I try to get the char from the user input it goes all poopy.
char * name;
cin >> name; //only this doesn't work
this should be simple in my head..
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!