From: <dz...@su...> - 2006-01-10 16:57:32
|
Mr=2E Lefebvre, In you "for()" loop you left out the "{" & "}" braces defining your loop=2E Try the following changes listed below=2E This worked for me=2E =2E=2EBob #include <stdio=2Eh> #include <stdlib=2Eh> main() { long nc; nc=3D0; for (nc=3D0; getchar()!=3DEOF; ++nc) { //opening brace for "for()" loop=2E printf("%ld\n",nc); system("Pause"); } //closing brace for "for()" loop=2E return 0; } --------------------------------------------------------------------Fr om: dev-cpp-users-admin@lists=2Esourceforge=2Enet [mailto:dev-cpp-users-admin@lists=2Esourceforge=2Enet] On Behalf Of Gary Lefebvre Sent: Tuesday, January 10, 2006 9:32 AM To: dev-cpp-users@lists=2Esourceforge=2Enet Subject: [Dev-C++] Loops #include <stdio=2Eh> #include <stdlib=2Eh> main() { long nc; nc=3D0; for (nc=3D0; getchar()!=3DEOF; ++nc); printf("%ld\n",nc); system("Pause"); return 0; } No matter what loop option I try I have the same result=2E The loop does not terminate when, after entering text, I press the enter key=2E The command window hangs=2E The loop will not terminate to proceed to the rest of the code=2E |