470,815 Members | 1,105 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

How can I manipulate text using managed C++

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()?


Feb 27 '06 #1
3 1366
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/de...ttingtypes.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);
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
Feb 27 '06 #2
Hi Mr. Restrepo,

I appreciate your help> I will try it. I like your Website.

"Tomas Restrepo (MVP)" <to****@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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/de...ttingtypes.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);
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/

Feb 28 '06 #3
I think you might look want to look at the StreamWriter and StreamReader
classes...

[==P==]

"Allen Maki" <al*********@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
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()?



Mar 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Stewart | last post: by
14 posts views Thread by Eric Lindsay | last post: by
1 post views Thread by Sam Learner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.