Home » U++ Library support » U++ Core » signature of the stou function
signature of the stou function [message #833] |
Fri, 03 February 2006 20:05 |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
Wouldn't it be better & more type-safe if the type of the endptr parameter in these functions would be const char **, and const wchar ** ?
unsigned stou(const char *s, void *endptr, unsigned base)
uint64 stou64(const char *s, void *endptr, unsigned base)
unsigned stou(const wchar *s, void *endptr, unsigned base)
|
|
|
|
Re: signature of the stou function [message #871 is a reply to message #854] |
Mon, 06 February 2006 14:09 |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
Another thing I am finding strange is the completely different naming for string->unsigned int and string->signed int conversion functions. Different function name, different parameter name (radix/base). I believe they should rather follow the same naming scheme: ScanInt and ScanUInt.
unsigned stou(const char *ptr, void *endptr = NULL, unsigned base = 10);
unsigned stou(const byte *ptr, void *endptr = NULL, unsigned base = 10);
unsigned stou(const wchar *ptr, void *endptr = NULL, unsigned base = 10);
int ScanInt(const char *ptr, const char **endptr = NULL, int radix = 10);
int ScanInt(const wchar *ptr, const wchar **endptr = NULL, int radix = 10);
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Sep 21 01:39:07 CEST 2024
Total time taken to generate the page: 0.02960 seconds
|