Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Visual Studio to xCode terminal differences - display formatting

Hi.
I'm converting a C++ terminal application from VS to xCode. The code executes perfectly; however, the formatting that was specified in VS is being rendered incorrectly in xCode.

Do the setprecision and setw() format manipulators get handled differently?

Example VS:

Text 5 15 More Text

Example xCode:

Text . 5 ... 15 ...... More Text

Notice that the columns being displayed are aligning at different intervals.

I'm just a bit confused as to why my spacing would be rendered differently. Maybe it's something to do with rendering the code in a Unix terminal vs. the "DOS" terminal?

Thanks for any information you can provide.

Sincerely,

Joseph Booth

Message was edited by: Joseph Booth

//added periods to force separation of columns to show alignment difference.

Mac G5 2 GHz 500GB 3 GB RAM, Mac OS X (10.4.11)

Posted on Sep 25, 2010 8:50 AM

Reply
2 replies

Sep 25, 2010 10:19 AM in response to Joseph Booth

Are you using tab characters to space out the results?

If so:
"Tab distance" is a fluid concept -- on some systems, the default is 4 characters, on others it's 6 or 8. On some systems, the tab distance is fixed and will always insert a fixed number of space. On others, the correct position is calculated. Some text editors allow the user to change the tab distance.

It would seem Windows' console uses another definition than Terminal does. Nothing you can do about that, except not using tabs at all.

Visual Studio to xCode terminal differences - display formatting

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.