You need to:
a. Read the tutorial on this site
b. Go to this new web site called Google, search for "strings in c", and actually visit some of the links that are returned from that search and read them.
You need to:
a. Read the tutorial on this site
b. Go to this new web site called Google, search for "strings in c", and actually visit some of the links that are returned from that search and read them.
Sorry, just found it, disregard that last question please. Thanks.
K, so valid question time.
If I usewill other FILE* pointers interfere with that? Because that is all that I can think of that is causing my compiler to "Unexpectedly Quit. Would you like to send an Error Report?" and I don't know what else would be doing it.Code:fgets ( string, 50, stdin );
The %s specification with scanf stops at the first white space character after the first "word".
You can use scanf() to pick up blanks too, but the syntax is a bit different for the format specifier.
See here:
http://www.cppreference.com/stdio/scanf.html
For instance, if you want to pick up all (up to) 80 characters up to and not including the newline, code:
Code:char response[81] ; scanf("%80[^\n]", response ) ;
Mainframe assembler programmer by trade. C coder when I can.
If you're using one of the Microsoft compilers, like Visual C++ Express, you should be able to clean from the Build menu, like Build -> Clean Solution, or something similar. Then you just recompile and relink like usual. Other IDEs have this option somewhere, try the help documents.
I got it to work with:Thanks for the help, and I will rebuild if it crashes again.Code:char response[81] ; scanf("%80[^\n]", response ) ;