I'm going straight to the point. This simple code should not return any values:
#include <stdio.h> int sum (int num) { static int s = 0; s+=num; } int main() { printf("%d ",sum(55)); printf("%d ",sum(45)); printf("%d ",sum(50)); return 0; }
but it actually returns:55 100 150
I'm sorry if I am being just plain stupid and not seeing something obvious, but my limited knowledge says the function "sum" does not return anything.