logo

Infinite loop through integer overflow

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char* argv[]) { int arr[256]; unsigned short i; // Infinite loop for (i = 0; i < 256; i++) { arr[i] = -5; printf("%d ", arr[i]); } return 0; }

Courses with this lesson