Store and Print string in C / C + +

Given this sentence as an input: "Hello my name and "John" (with its spaces and capital letters), print it on the screen .. NB the phrase must be entered from the keyboard all at once ... you can do this in C / C + +?
You can do it easily in C++, it is very difficult to do in C.

For C++, look up std::string and std::getline.
Last edited on
In C you've got the getline() and getdelim() GNU/POSIX functions:

You can also roll your own stuff:
closed account (jwkNwA7f)
Topic archived. No new replies allowed.