can someone write source code for strtoul (string to unsigned long)
thanks
Printable View
can someone write source code for strtoul (string to unsigned long)
thanks
>can someone write source code for strtoul (string to unsigned long)
Yes, I sure can.
-Prelude
I heard it's impossible :rolleyes: Bet you can't really do it Prelude. :p :D
dsugard : If you didn't spot the sarcasm, I say now there's plenty here ;) What is it you're trying to do? Is this a homework thing? Whatever it is, try writing something yourself, and post your code when you have troubles with it, then people will be willing to help you.
u can find all the code to the inbuilt functions if u look in the program files of the MS visual studio..
the header files are under the folder 'include'
and the functions tend to be under CRT
to Moi and others,
in the code given here http://tcl.apache.org/sources/tcl/compat/strtoul.c.html
how come all non digit characters be mapped to value 100? also how many non digit characters would be know beforehand?
static char cvtIn[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* '0' - '9' */
100, 100, 100, 100, 100, 100, 100, /* punctuation */
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'A' - 'Z' */
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35,
100, 100, 100, 100, 100, 100, /* punctuation */
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'a' - 'z' */
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35};
dood, read the fricking code. i'll even tell you: line 168 and 185 are good places to start. :rolleyes:Quote:
Originally posted by dsugard
to Moi and others,
in the code given here http://tcl.apache.org/sources/tcl/compat/strtoul.c.html
how come all non digit characters be mapped to value 100? also how many non digit characters would be know beforehand?
static char cvtIn[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* '0' - '9' */
100, 100, 100, 100, 100, 100, 100, /* punctuation */
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'A' - 'Z' */
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35,
100, 100, 100, 100, 100, 100, /* punctuation */
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'a' - 'z' */
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35};