-
June 28th, 2013, 09:27 PM
#1
[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:
Code:
char * name = "bob";
only have the user input it.
something like:
Code:
char * name;
cin >> name; //only this doesn't work
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.
any help?
this should be simple in my head..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|