current is never equal to 2Originally Posted by esbo
current is never equal to 2Originally Posted by esbo
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
And current is never an even number either. Stick this in BEFORE the if at line 13:
Whoops! This is not the fibonacci sequence at all!Code:printf("current=%d prev=%d prev2=%d\n",current,prev,prev2);
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge