Click here to Skip to main content
15,895,192 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to monitor application's access to network (say,internet)? Pin
abc8764-Oct-03 2:14
abc8764-Oct-03 2:14 
AnswerRe: how to monitor application's access to network (say,internet)? Pin
Alexander M.,5-Oct-03 6:07
Alexander M.,5-Oct-03 6:07 
Questionhow to draw pixel by pixel? Pin
coda_x3-Oct-03 17:37
coda_x3-Oct-03 17:37 
AnswerRe: how to draw pixel by pixel? Pin
J. Dunlap3-Oct-03 17:51
J. Dunlap3-Oct-03 17:51 
AnswerRe: how to draw pixel by pixel? Pin
Terry O'Nolley4-Oct-03 4:52
Terry O'Nolley4-Oct-03 4:52 
QuestionHow to check whether a buffer contains a double number? Pin
George23-Oct-03 17:31
George23-Oct-03 17:31 
AnswerRe: How to check whether a buffer contains a double number? Pin
peterchen3-Oct-03 20:27
peterchen3-Oct-03 20:27 
GeneralRe: How to check whether a buffer contains a double number? Pin
George23-Oct-03 20:52
George23-Oct-03 20:52 
#include <stdio.h>
#include <stdlib.h>

Thanks, peterchen buddy!

I found your code is not working properly, Here is a piece of sample code, which should return 0, but it returns 1 instead.

Source Code:

--------
int main (int argc, char** argv)
{
char* end = NULL;
char buf [5] = "123.4";
double x = strtod (buf, &end);

if ((*end != '\0') || (!finite (x)))
{
// not valid
return 1;
}

//valid
return 0;
}
--------

Is there something wrong?


regards,
Geo
GeneralRe: How to check whether a buffer contains a double number? Pin
Dominik Reichl4-Oct-03 1:28
Dominik Reichl4-Oct-03 1:28 
GeneralRe: How to check whether a buffer contains a double number? Pin
Bo Hunter4-Oct-03 9:25
Bo Hunter4-Oct-03 9:25 
GeneralRe: How to check whether a buffer contains a double number? Pin
George24-Oct-03 16:45
George24-Oct-03 16:45 
GeneralRe: How to check whether a buffer contains a double number? Pin
Dominik Reichl4-Oct-03 22:56
Dominik Reichl4-Oct-03 22:56 
GeneralRe: How to check whether a buffer contains a double number? Pin
George24-Oct-03 23:25
George24-Oct-03 23:25 
GeneralRe: How to check whether a buffer contains a double number? Pin
George24-Oct-03 16:42
George24-Oct-03 16:42 
GeneralRe: How to check whether a buffer contains a double number? Pin
Dominik Reichl4-Oct-03 23:00
Dominik Reichl4-Oct-03 23:00 
GeneralRe: How to check whether a buffer contains a double number? Pin
George24-Oct-03 23:22
George24-Oct-03 23:22 
QuestionWhat's the difference between C's printf and C++'s cout? Pin
Link26003-Oct-03 16:17
Link26003-Oct-03 16:17 
AnswerRe: What's the difference between C's printf and C++'s cout? Pin
Ian Darling3-Oct-03 22:22
Ian Darling3-Oct-03 22:22 
GeneralRe: What's the difference between C's printf and C++'s cout? Pin
Mike Dimmick3-Oct-03 23:44
Mike Dimmick3-Oct-03 23:44 
GeneralRe: What's the difference between C's printf and C++'s cout? Pin
Ian Darling4-Oct-03 2:03
Ian Darling4-Oct-03 2:03 
GeneralRe: What's the difference between C's printf and C++'s cout? Pin
Kevin McFarlane4-Oct-03 0:23
Kevin McFarlane4-Oct-03 0:23 
GeneralCHtmlView - form without SUBMIT button Pin
trof3-Oct-03 14:36
trof3-Oct-03 14:36 
GeneralRe: CHtmlView - form without SUBMIT button Pin
Neville Franks4-Oct-03 11:59
Neville Franks4-Oct-03 11:59 
GeneralRe: CHtmlView - form without SUBMIT button Pin
trof5-Oct-03 9:07
trof5-Oct-03 9:07 
GeneralRe: CHtmlView - form without SUBMIT button Pin
Neville Franks5-Oct-03 11:01
Neville Franks5-Oct-03 11:01 

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.