How can I manipulate text using managed C++

  • Thread starter Thread starter Allen Maki
  • Start date Start date
A

Allen Maki

I am using multiple arrays to make tables of rows and columns.



When using C++ I was able to manipulate texts by using

cout << setw(3) << .... using directives iomanip.h and iostream.h.



Now, when using managed C++, How can we do the same manipulation by with
Console::Write() and Console::WriteLine()?
 
Hi Allen,
When using C++ I was able to manipulate texts by using

cout << setw(3) << .... using directives iomanip.h and iostream.h.

Now, when using managed C++, How can we do the same manipulation by with
Console::Write() and Console::WriteLine()?

You can use formatting strings as part of your WriteLine() statements, which
you'll find documented here:

http://msdn.microsoft.com/library/d...y/en-us/cpguide/html/cpconformattingtypes.asp

for example, if you were to print an integer value in hex, right-aligned on
a 8 digit boundary you might do something like:

Console::WriteLine("{0,8:X}", intValue);
 
I think you might look want to look at the StreamWriter and StreamReader
classes...

[==P==]
 
Back
Top