Created
April 26, 2013 20:01
-
-
Save manvscode/5470068 to your computer and use it in GitHub Desktop.
A subtle bug--what is the output?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int array[]={ 34, 2, 54, -6, -49}; | |
#define S sizeof(array)/sizeof(array[0]) | |
int main() | |
{ | |
int d = -1; | |
if( d < S ) | |
printf("apple\n"); | |
else | |
printf("banana\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment