Convert Strings to Numbers : String to Number « Data Type « Visual C++ .NET

Home
Visual C++ .NET
1.2D
2.Class
3.Collections
4.Data Type
5.Database ADO.net
6.Delegate
7.Development
8.File Directory
9.Function
10.Generics
11.GUI Form
12.Language Basics
13.Network
14.Reflection
15.Security
16.Statement
17.Structure
18.Thread
19.XML
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Visual C++ .NET » Data Type » String to Number 
Convert Strings to Numbers
 



#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
int main(void) {
    int a = Int32::Parse("123");
    int b = Int32::Parse("$547,295.00");
    double c = Double::Parse("123.456");
    double d = Double::Parse("5.743955e+005");
    Console::WriteLine(a);
    Console::WriteLine(b);
    Console::WriteLine(c);
    Console::WriteLine(d);
    return 0;
}

   
  
Related examples in the same category
1.Convert String to decimal
2.parse the string to get the integer value
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.