code spacing

How do I make the output spaced in the console in this code?

cout<<"Here's my information: "" My name is " <<MyName<< "I'm "<<MyAge<< "and I live in "<<MyCity<<endl;


In the output it's doing this "My name is JoeI'm 30I live in Boston"


______________________________________
(previous topic below)

Hi, I am new to programming.

I have 2 questions.

1. How do I simply make the console have a space between the questions and answers?

2. How do I make the program ignore anything that is not an acceptable answer.

Example: How old are you?

"I'm 500,250 years old." (unless they are a resurrected dinosaur)

or What is your name?

"I am #2"

/////

In my program you can see I simply want to restate their name. So if they were to say

"I am Joe" The only way to restate only the name I suppose would create a filter list of sorts to ignore statements like "My name is ()", "I am()" , "they call me ()"

output : [IMG]http://i1357.photobucket.com/albums/q743/Simon_Crawford/howtoforumpost_zpsd6ef3f7c.jpg[/IMG]

code: [IMG]http://i1357.photobucket.com/albums/q743/Simon_Crawford/programminghelp00000001_zpsa16ef595.jpg[/IMG]
Last edited on
blink2 wrote:
1. How do I simply make the console have a space between the questions and answers?
std::cout << std::endl;
thank you L B!
bump
Well I see that if I put a space before each beginning quotation mark it does the job. I suppose that will work.
http://www.cplusplus.com/reference/cctype/isdigit/?kw=isdigit
http://www.cplusplus.com/forum/windows/94651/

just read from the links and u should be able to solve your problem. and u can search the post in the forum for the same thing.
Last edited on
Topic archived. No new replies allowed.