Click here to Skip to main content
16,013,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionstring s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
mrby12315-Mar-06 18:01
mrby12315-Mar-06 18:01 
AnswerRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Hamid_RT15-Mar-06 18:12
Hamid_RT15-Mar-06 18:12 
GeneralRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
mrby12315-Mar-06 18:15
mrby12315-Mar-06 18:15 
GeneralRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Hamid_RT15-Mar-06 18:17
Hamid_RT15-Mar-06 18:17 
GeneralRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
mrby12315-Mar-06 18:29
mrby12315-Mar-06 18:29 
AnswerRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Johann Gerell15-Mar-06 20:02
Johann Gerell15-Mar-06 20:02 
GeneralRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Nemanja Trifunovic16-Mar-06 2:13
Nemanja Trifunovic16-Mar-06 2:13 
GeneralRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Johann Gerell16-Mar-06 2:38
Johann Gerell16-Mar-06 2:38 
Nemanja Trifunovic wrote:
I can't understand why people still use atof


Me neither, but that was not the point of my post.

I personally use
long strtol( const char *nptr, char **endptr, int base );
long wcstol( const wchar_t *nptr, wchar_t **endptr, int base );
with which a 0 return value can be checked against the endptr parameter to see if a conversion occurred or not.

--
The Blog: Bits and Pieces
GeneralRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Nemanja Trifunovic16-Mar-06 3:08
Nemanja Trifunovic16-Mar-06 3:08 
AnswerRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
normanS15-Mar-06 18:13
normanS15-Mar-06 18:13 
AnswerRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Nibu babu thomas15-Mar-06 18:16
Nibu babu thomas15-Mar-06 18:16 
GeneralRe: string s1 = "abcd" string s2 = "2.53", how to detect that s2 representing a numeber? Pin
mrby12315-Mar-06 18:24
mrby12315-Mar-06 18:24 
GeneralRe: string s1 = "abcd" string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Nibu babu thomas15-Mar-06 18:29
Nibu babu thomas15-Mar-06 18:29 
GeneralRe: string s1 = "abcd" string s2 = "2.53", how to detect that s2 representing a numeber? Pin
mrby12315-Mar-06 18:41
mrby12315-Mar-06 18:41 
GeneralRe: string s1 = "abcd" string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Nibu babu thomas15-Mar-06 18:49
Nibu babu thomas15-Mar-06 18:49 
AnswerRe: string s1 = "abcd"; string s2 = "2.53", how to detect that s2 representing a numeber? Pin
Johann Gerell16-Mar-06 2:38
Johann Gerell16-Mar-06 2:38 
Question"History Folder" in office applications Pin
Anil_vvs15-Mar-06 17:56
Anil_vvs15-Mar-06 17:56 
QuestionHow to enable disabled check box Pin
Joy Anne15-Mar-06 17:49
Joy Anne15-Mar-06 17:49 
AnswerRe: How to enable disabled check box Pin
Nibu babu thomas15-Mar-06 17:51
Nibu babu thomas15-Mar-06 17:51 
GeneralRe: How to enable disabled check box Pin
jhwurmbach16-Mar-06 6:38
jhwurmbach16-Mar-06 6:38 
GeneralRe: How to enable disabled check box Pin
Nibu babu thomas16-Mar-06 16:52
Nibu babu thomas16-Mar-06 16:52 
GeneralRe: How to enable disabled check box Pin
jhwurmbach16-Mar-06 21:50
jhwurmbach16-Mar-06 21:50 
GeneralRe: How to enable disabled check box Pin
Nibu babu thomas16-Mar-06 22:39
Nibu babu thomas16-Mar-06 22:39 
AnswerRe: How to enable disabled check box Pin
Hamid_RT15-Mar-06 20:08
Hamid_RT15-Mar-06 20:08 
Questionhow to interrrogate line by line, pick-up "Shmplk Reta : 1024 wps#, and store the three columns numbers into x[],y[],z[] Pin
mrby12315-Mar-06 17:16
mrby12315-Mar-06 17:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.