Click here to Skip to main content
15,890,845 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Building and testing a deskband Pin
Aamir Butt13-Dec-05 21:07
Aamir Butt13-Dec-05 21:07 
QuestionAddress of a Class object Pin
ddmcr13-Dec-05 8:17
ddmcr13-Dec-05 8:17 
AnswerRe: Address of a Class object Pin
Chris Losinger13-Dec-05 9:08
professionalChris Losinger13-Dec-05 9:08 
AnswerRe: Address of a Class object Pin
Dominik Reichl13-Dec-05 9:10
Dominik Reichl13-Dec-05 9:10 
AnswerRe: Address of a Class object Pin
TheGreatAndPowerfulOz13-Dec-05 9:11
TheGreatAndPowerfulOz13-Dec-05 9:11 
GeneralRe: Address of a Class object Pin
#realJSOP13-Dec-05 10:10
mve#realJSOP13-Dec-05 10:10 
GeneralRe: Address of a Class object Pin
TheGreatAndPowerfulOz13-Dec-05 10:56
TheGreatAndPowerfulOz13-Dec-05 10:56 
QuestionC language string to float conversion ... Pin
Maximilien13-Dec-05 7:38
Maximilien13-Dec-05 7:38 
( edited ... to change the subject line which was wrong ... Unsure | :~ )

(it's been one of those week ... and we're only tuesday ... )

now, I'm confused, is there a better C API than atof, scanf or strtod ? if my input string is not a well formed number ( either plain float number like 2.345 or scientific notation like "1.3e3" ) most of those will work.

double d = atof( "2 3" );
ASSERT( d == 2 );


float f = 0.0;
int iError = sscanf( "2f3", "%f", &f );
ASSERT( iError != EOF );
ASSERT( f == 2 );


char *stopstring;
float f1 = (float)strtod( "2v3", &stopstring );
ASSERT( f1 == 2 );


Is there a all inclusive API that will validate the input ? and give an error when a string that is NOT a valid number is entered.

I know I can do a heck of a lot of pre-validation beforehand on the input string, but it seems that is should be done by an existing API ...

Thanks.



Maximilien Lincourt
Your Head A Splode - Strong Bad

-- modified at 13:49 Tuesday 13th December, 2005
AnswerRe: C language float to string conversion ... Pin
Jim Crafton13-Dec-05 7:49
Jim Crafton13-Dec-05 7:49 
AnswerRe: C language string to float conversion ... Pin
PJ Arends13-Dec-05 8:38
professionalPJ Arends13-Dec-05 8:38 
GeneralRe: C language string to float conversion ... Pin
Maximilien13-Dec-05 9:30
Maximilien13-Dec-05 9:30 
QuestionHow to force the initial directory to be 'My Computer' Pin
Cyrus Dang13-Dec-05 7:10
Cyrus Dang13-Dec-05 7:10 
AnswerRe: How to force the initial directory to be 'My Computer' Pin
TheGreatAndPowerfulOz13-Dec-05 9:16
TheGreatAndPowerfulOz13-Dec-05 9:16 
GeneralRe: How to force the initial directory to be 'My Computer' Pin
Cyrus Dang13-Dec-05 9:33
Cyrus Dang13-Dec-05 9:33 
GeneralRe: How to force the initial directory to be 'My Computer' Pin
TheGreatAndPowerfulOz13-Dec-05 9:50
TheGreatAndPowerfulOz13-Dec-05 9:50 
GeneralRe: How to force the initial directory to be 'My Computer' Pin
Cyrus Dang13-Dec-05 10:25
Cyrus Dang13-Dec-05 10:25 
GeneralRe: How to force the initial directory to be 'My Computer' Pin
TheGreatAndPowerfulOz13-Dec-05 13:16
TheGreatAndPowerfulOz13-Dec-05 13:16 
GeneralRe: How to force the initial directory to be 'My Computer' Pin
Cyrus Dang13-Dec-05 14:06
Cyrus Dang13-Dec-05 14:06 
GeneralRe: How to force the initial directory to be 'My Computer' Pin
TheGreatAndPowerfulOz13-Dec-05 17:12
TheGreatAndPowerfulOz13-Dec-05 17:12 
GeneralRe: How to force the initial directory to be 'My Computer' Pin
TheGreatAndPowerfulOz14-Dec-05 6:39
TheGreatAndPowerfulOz14-Dec-05 6:39 
GeneralRe: How to force the initial directory to be 'My Computer' Pin
Cyrus Dang14-Dec-05 6:48
Cyrus Dang14-Dec-05 6:48 
GeneralRe: How to force the initial directory to be 'My Computer' Pin
TheGreatAndPowerfulOz14-Dec-05 8:39
TheGreatAndPowerfulOz14-Dec-05 8:39 
QuestionReading Screen/Frame Buffer Pin
Identity Undisclosed13-Dec-05 7:10
Identity Undisclosed13-Dec-05 7:10 
AnswerRe: Reading Screen/Frame Buffer Pin
Jim Crafton13-Dec-05 7:46
Jim Crafton13-Dec-05 7:46 
GeneralRe: Reading Screen/Frame Buffer Pin
Identity Undisclosed13-Dec-05 17:20
Identity Undisclosed13-Dec-05 17:20 

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.