a newbie gcc compiler and c language question

Posted by dydx on Stack Overflow See other posts from Stack Overflow or by dydx
Published on 2010-03-27T08:25:40Z Indexed on 2010/03/27 8:33 UTC
Read the original article Hit count: 173

Filed under:
|

Hi, when I'm trying to compile my c program it gives me this error warning: integer constant is too large for 'long' type

which refers to these lines

int barcode, a, b, c;
scanf("%d", &barcode);
a = barcode / 1000000000000;
b = barcode / 100000000000 % 10;
c = barcode / 10000000000 % 10;

and the rest is fine. I know I'm not supposed to use int for such a large number, any suggestions on what I should use? if I replace int with double what should the '%d' part be replaced with then?

© Stack Overflow or respective owner

Related posts about c

    Related posts about language