Talk:C string

From Wikipedia, the free encyclopedia

I am facing a problem in C language. I want to convert String into Long.

char* s = "hello"; long l;

l = atol(s); cout<<l;

it returns me 0.

can anybody solve this problem. I am waitinf for ur kind replies... Thank you

The string "hello" isn't numeric so it can't be converted to a number (whether int, long, or what-have-you).
Atlant 12:53, 9 November 2005 (UTC)
As a side note, the language used above cannot be C, since cout is used. cout is used in C++.
81.234.182.189 14:42, 31 January 2007 (UTC)