|
-
September 23rd, 2010, 06:38 AM
#1
what is the replacement to scanf in managed c++/cli
hello i want to know the replacement of sscanf, sprintf in managed c++/cli
thanks in advance
-
September 23rd, 2010, 12:50 PM
#2
Re: what is the replacement to scanf in managed c++/cli
The "real .NET way" of doing console I/O is using the System::Console class. AFAIK there is, however, no direct .NET equivalent to scanf() (mentioned in the title of the thread). You would have to use the Console::Read...() members to read in character strings and then convert them using the .Parse() members that several of the .NET types offer, like this one for instance.
An equivalent of sprintf(), like you asked for in the body of your post, can be the String::Format() method. Again, there's no direct equivalent to sscanf(), but you can use the .Parse() members of the individual types already mentioned above.
Aside from that, you can also use C++ runtime classes or functions in C++/CLI, including iostreams, sscanf() and sprintf(). They don't have direct support for the .NET-specific types though.
HTH
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|