| | |
i++ and ++i
![]() |
Not only is your example horribly broken, it's not even a valid example of the point you're trying to make.
>void main()
Implementation-defined behavior. main is required to return int.
>printf("%d,%d,%d",i,i++,++i);
Undefined behavior. The commas in an argument list do not constitute sequence points, and ++ modifies its operand.
Undefined behavior. You didn't include stdio.h, and functions that take variable arguments require a prototype in scope.
>getch();
Implementation-defined behavior. You didn't include a header that declares getch, and getch isn't a standard function.
>void main()
Implementation-defined behavior. main is required to return int.
>printf("%d,%d,%d",i,i++,++i);
Undefined behavior. The commas in an argument list do not constitute sequence points, and ++ modifies its operand.
Undefined behavior. You didn't include stdio.h, and functions that take variable arguments require a prototype in scope.
>getch();
Implementation-defined behavior. You didn't include a header that declares getch, and getch isn't a standard function.
I'm here to prove you wrong.
![]() |
Other Threads in the C Forum
- Previous Thread: Compiling Multiple files in a single Project
- Next Thread: Information on function pointers
| Thread Tools | Search this Thread |
#include adobe api array arrays asterisks binarysearch calculate char cm copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile createprocess() csyntax database directory dynamic feet fflush fgets file fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking highest homework i/o inches include incrementoperators input interest kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix meter microsoft mqqueue mysql number odf open openwebfoundation owf pattern pdf performance pointer posix probleminc process program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling segmentationfault send sequential shape socket socketprograming socketprogramming stack standard string systemcall turboc unix user voidmain() wab win32api windows.h






