conversion char to long long from record

Hi experts,
need your help, i have problem with retrieve the data from record, here the code :

1
2
long long temp_amount=0;
temp_amount_usd  = atoll(student.f9_cbl_usd_amt);

the value when i debug :
1
2
3
4
(gdb) p student.f9_cbl_usd_amt
$3 = '0' <repeats 14 times>, "1500"
(gdb) p temp_amount_usd
$4 = 52503009458201405


this value are for next variable in the struct(student.blaablablaa). I'm still newbie, need ur help experts, why its read for next data struct?..

Thankyou
btw, there's no such type as "long long"... or am i the only one who don't know this?
yes, it has, long long same like long int(long)
see : http://www.cplusplus.com/doc/tutorial/variables/
No. "long long" is a 64 bit type on 32 bit machines. It is the equivalent to Java's long type. long int is equivalent to java's int.

On my compiler:
char -> __int8
short -> __int16
short int -> __int16
int -> __int32
long -> __int32
long int -> __int32
long long -> __int64
long long int -> __int64
float is 32 bits
double is 64 bits
long double is 64 bits
Last edited on
thank you for correct sir, im still learn in C

btw Thank you for all ur respond, im appreciate it..
i have fixed that problem, i just store to temp variable and then convert into long long type..
Last edited on
Topic archived. No new replies allowed.