[[lesson_5_overflow.c]] Rescued by C++ Reloaded

Route:


[user02@FC4 Lesson05]$ cat -n overflow.c
1 #include <stdio.h> 2 3 int main(void) 4 { 5 int positive = 40000; 6 long big_positive = 4000000000; 7 char little_positive = 210; 8 9 printf("positive now contains %d\n", positive); 10 printf("big_positive now contains %ld\n", big_positive); 11 printf("little_positive now contains %c\n", little_positive); 12 13 return 0; 14 }
[user02@FC4 Lesson05]$ gcc -o overflow overflow.c
overflow.c: In function ?emain?f:
overflow.c:6: warning: this decimal constant is unsigned only in ISO C90
[user02@FC4 Lesson05]$ ./overflow
positive now contains 40000
big_positive now contains -294967296
little_positive now contains O
lesson_5_overflow.c, Rev. 1, Last changed on 2005-08-08 04:37, 344 page hits
Wiki hosted for free at wikihost.org || RSS-Feed || GeboGebo 1.3.3 || 00.205 seconds || || PAGERANK TOOLS