문제

What is the C equivalent of Convert.ToInt16(String) method of C#? In my case my string is a char array. Thanks

도움이 되었습니까?

해결책

You could try atoi.

다른 팁

Use atoi or strtol.

int n = atoi(s)

you can also use sscanf

sscanf("%i", myCharPointer, &myIntVar);

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top