How come gets() works in my main, but if I call it in a void function (example: void change(char * string) ) it won't let me input from the keyboard?
lets say I have this
*psuedo-code btw
void change(char * string)
{
gets(string);
}
now gets(string) SHOULD give me a keyboard-input prompt right? It doesn't though. It will if I did the gets(string) in the MAIN...but in a void function..it simply assigns string to "" and exits. Can anyone tell my why and how may I go about fixing this? BTW this is for a line, not a string (so scanf won't work).
lets say I have this
*psuedo-code btw
void change(char * string)
{
gets(string);
}
now gets(string) SHOULD give me a keyboard-input prompt right? It doesn't though. It will if I did the gets(string) in the MAIN...but in a void function..it simply assigns string to "" and exits. Can anyone tell my why and how may I go about fixing this? BTW this is for a line, not a string (so scanf won't work).