|
-
March 19th, 2009, 12:29 PM
#1
Convert Numbers to/from Strings problem
Hi all,
We are doing a project which optimizes the source code of our system.
This system is very old and written by VC6.
Two of optimized contents are:
- Replace all conversion functions, which convert Strings to Numbers, with strtod and strtol functions. The reasons are to use error checking mechanism of strtod and strtol functions (Check overflow).
- The second content is to optimize conversion functions, which convert Numbers to Strings.
I think using itoa function is a bad idea because itoa is not a C standard function. Using sscanf is not good, because it has no error checking mechanism. I am thinking about using sprintf() function, but someone told me that this function is not safetype.
So could you please provide some suggestion on the second content?
Should I use STL class?
Regards,
Tevez
Last edited by tevez; March 19th, 2009 at 12:32 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|