Hi, I would like to know what function should I use if I want the user to input a string with the new-line character. fgets terminates reading after a new-line character is found.
Hi, I would like to know what function should I use if I want the user to input a string with the new-line character. fgets terminates reading after a new-line character is found.
It depends. For example, you could use fgetc and read until some other character that signals the end of the input, or until a certain number of characters has been read. It may still be feasible to use fgets, depending on how exactly you want to read the input.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Well... you could add it manually.... Take a look at the strcat() function in your docs.