Skip to content
Advertisement

Tag: long-integer

string to long, not giving me the correct answer

I am trying to convert number stored in the c string to long int. But I am not getting the expected output: Output : 821493369 gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) Can you please advise what am I doing wrong here? Thanks. Answer In addition to using long long, you can use exact width types from stdint.h. For instance,

Advertisement