converting bake twine the underlying information type
i have string(char*), i need the underlying datatype such int, float, double, short, long, only impression array containing alphabets with out digits(like varchar sql).
for ex:
char* str1 = "12312"
char* str2 = "231.342"
char* str3 = "234234243234"
char* str4 = "4323434.2432342"
char* str5 = "i enclose wholly alphabets"
given strings, i need initial twine form int typecast an int, on ex:
int no1 = atoi(str1)
float no2 = atof(str2)
long no3 = atol(str3)
double no4 = strtod(str4)
char* varchar1 = strdup(str5)
clarifying bit more...
i have twine the essence alphabets and/or digits and/or special characters. right now, i am means parse twine
- identify contains wholly digits,
here i modify twine brief int long, formed best fit. ( how i know twine converted an brief int long?) - only alphabets, leave string.
- digits unparalleled decimal point.
here i need modify twine boyant double ( same doubt here) - other. leave string
Comments
Post a Comment