English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

3 answers

use atoi(char) to convert char to int.
use atol(char) to convert char to long.
use atof(char) to convert char to float.

2006-12-08 19:37:57 · answer #1 · answered by HM H 2 · 0 0

Since C# is a real programing langyuage, you need to know the type you are converting to.

Use one of the functions:
Convert.ToInt32(val)
Convert.ToDouble(val)
Convert.ToString(val)
depending on the type you want to get.

you can search the Convert class for more functions

2006-12-09 05:31:30 · answer #2 · answered by Ahmad Nasser 2 · 0 0

You could do for instance:

string s = "123";
int n = int.Parse(s);

Regards

2006-12-09 04:07:08 · answer #3 · answered by BoyScout 2 · 0 0

fedest.com, questions and answers