I am pretty sure my code is right i copied it right out of the book. But for some reason I get this error message
First-chance exception at 0x667f6af2 (msvcr90d.dll) in doingWallE.exe: 0xC0000005: Access violation writing location 0x00000000.
Unhandled exception at 0x667f6af2 (msvcr90d.dll) in doingWallE.exe: 0xC0000005: Access violation writing location 0x00000000.
I know how while loops work, but I went back to my book to make sure I was doing it right because my project would give me the same error message. Then I copied this test code right at the book and all of the sudden I am getting the same error message. This happens only when I use do while loops. Can anyone tell me why is this happening?Code:#include "stdafx.h" #include "stdio.h" int main() { int value; do { printf("\n\nenter a number: "); scanf(" %d, &value"); } while(value<=20); return (0); }
Also the program runs but it crashes as soon as I enter any input (a number below or above 20)



LinkBack URL
About LinkBacks


