Form a string using chars with the .push_back() function with white spaces

How can I have a program read a set number of characters (including white-spaces) then form a string with said characters using the .push_back() function?

Problem with input? If yes, u can input chars, while your char not equal to EOF or something else(how u want), and just push_back into string, if my answer not for u, describe your problem more concretely pls,
attach your code, input/output.