Why don't you just tell us your teacher's email address so that we can send the program directly?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>I know a bunch of graduated dudes that don't know how to code a damn Fibonacci sequence.
I know about half a dozen professional programmers who couldn't get a recursive function to calculate the Fibonacci sequence right on the first try. Then again, I also know quite a few who would churn out several versions including recursive, non-recursive, dynamic recursive, and heuristic formula without breaking a sweat and then dare you to find a bug. ;)
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Perhaps ankara didn't know how to use a text editor for typing in C code.
Then again, I also know quite a few who would churn out several versions including recursive, non-recursive, dynamic recursive, and heuristic formula without breaking a sweat and then dare you to find a bug. ;)
You've got to stop talking about yourself in the third person. ;)
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
>some of them work as teachers! LMAO
I have no respect for programming teachers in general. There are exceptions, of course, but for the most part I wouldn't trust a programming "professor" with any language more dangerous than pseudocode, and then only if they never try to teach it. I think the biggest flame war I ever participated in was when a self-proclaimed college professor insisted that i = i++ was perfectly legal in C. :rolleyes:
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Hi everyone,
I think the biggest flame war I ever participated in
You forgot about my Java taking over C++ thread in the C++ forum.a self-proclaimed college professor insisted that i = i++ was perfectly legal in C
i = i++ is absolutely 100% legal in C.
Hoping to hear from you
Richard West
*****************************************************
freesoft_2000
Practically a Master Poster
623 posts since Jun 2004
Reputation Points: 25
Solved Threads: 10
>You forgot about my Java taking over C++ thread in the C++ forum.
Just because it was your worst, doesn't mean it was mine. ;)
>i = i++ is absolutely 100% legal in C.
Nice try.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Woah woah woah. What's so illegal with 'i=i++'? Wouldn't it just try to increment i, and then set i equal to the original value of i, making the ++ do effectively nothing? That's what it does when I try it, but I don't have a straight C compiler handy..
-Fredric
Daishi
Junior Poster in Training
80 posts since Aug 2005
Reputation Points: 10
Solved Threads: 2
Woah woah woah. What's so illegal with 'i=i++'? Wouldn't it just try to increment i, and then set i equal to the original value of i, making the ++ do effectively nothing? That's what it does when I try it, but I don't have a straight C compiler handy..
-Fredric
wrong. it is undefined behavior. some compilers the final version is the original version but on other compilers it final value is the incremented value. VC++ 6.0 is incremented value, but Dev-C++ is the original value. So, although the statement compiles (no illegal syntax error) it produces behavior that has not been defined by c or c++ standrds.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>some of them work as teachers! LMAO
I have no respect for programming teachers in general. There are exceptions, of course, but for the most part I wouldn't trust a programming "professor" with any language more dangerous than pseudocode
and just who do you suppose actually wrote the language(s)? Those guys have Ph.D. and taught college courses for many years. So you can't judge all teachers on the bases of one idot :lol:
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Heh, didn't realize that. :p Can you think of any other weird things like that in C?
-Fredric
Daishi
Junior Poster in Training
80 posts since Aug 2005
Reputation Points: 10
Solved Threads: 2
Heh, didn't realize that. :p Can you think of any other weird things like that in C?
-Fredric
yes -- one very common problem. fflush() is only defined for output streams, not input streams. Some compilers (like VC++ 6.0) support them, but compilers are not required to.
fflush(stdin);
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>So you can't judge all teachers on the bases of one idot
I do recall saying that there were exceptions, but in my experience, the majority of teachers only teach because they're not good enough to actually write code for a living.
>Can you think of any other weird things like that in C?
I can think of countless weird things like that in C. ;)
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
but in my experience, the majority of teachers only teach because they're not good enough to actually write code for a living.
You must be hanging around the wrong crowd :lol: Many people with Ph.D.s (in computer science) teach because they are over-qualified for jobs. Software houses don't need (or want) Ph.D.s to write code, and masters degree is streatching it. Most teachers that do not have Ph.D. have masters degrees and only teach part time -- they hold down full-time programming positions in industry (I work with someone like that).
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439