How to use tab(/t) with Format

Mar 10, 2013 at 4:25am
Hey, I am working on some code where I need to print out some strings but will like to tab after printing each string. I know you can use the tab escape key with printf but it doesn't work when I use it with Format. So at this point I will like to know how to tab when using Format? Any help will greatly be appreciated.
Mar 10, 2013 at 5:30am
- I believe it's

1
2
3

cout<<"Hello \t World"<<endl;


- I could be mistaken though.
Mar 10, 2013 at 6:34am
So I can't do the following:
1
2
3
CString mstatus;
mstatus.Format("Name" "\t""Address""\t""Phone Number");


I want the output to look like this:
Name Address Phone Number

I want a couple of spaces after each heading.

If I can't use \t what can I use to get this output with Format?
Last edited on Mar 10, 2013 at 11:25am
Mar 10, 2013 at 1:47pm
That should work. You don't have to put each string in double quotes, you can write it as follows.

mstatus.Format("Name\tAddress\tPhone Number");
Topic archived. No new replies allowed.