Does anyone know how to convert a "String^" data type in a visual studio 2005 forms app to an "int"? Ive tried atoi and casting to no success. Any ideas? Thanks.
Nemoticchigga
0
Junior Poster in Training
Recommended Answers
Jump to Posttry
Int32::Parse(stringname)
Jump to PostC++/CLI handles boxing and unboxing implicitly. Either of these work just peachy:
using namespace System; #include <iostream> int main() { String^ s = "123"; int x = Convert::ToInt32(s); std::cout << x * x << '\n'; }
using namespace System; #include <iostream> int main() { …
All 6 Replies
William Hemsworth
1,339
Posting Virtuoso
Radical Edward
301
Posting Pro
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
Nemoticchigga
0
Junior Poster in Training
Radical Edward
301
Posting Pro
Nemoticchigga
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.