Re: [Dev-C++] Scanf crashes with error....
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2002-11-25 16:15:28
|
Try
scanf("%i",&SquadSize);
scanf always needs the ADDRESS where to put the result.
/Per W
On Mon, 25 Nov 2002, Dwayne Miller wrote:
> I am writing a simple program, to refresh my C programming skills (which
> were admittly not very good to begin with).
>
>
> Whenever I execute a line with a scanf statement. It crashes giving a
> windows error: <program> has caused a page fault in MSVCRT.DLL.
>
> I can post the registers if that helps.
>
>
> Any suggestions on what I have wrong?
>
> Thanks,
>
> Dwayne Miller
> Barberton, Ohio
>
>
> Code line:
> scanf("%i",SquadSize);
>
> Where: SquadSize has been declared type int.
>
> If it helps, latest version of Dev-Cpp, the program is written in C.
> Running on Celeron 400, with 128 megs of memory.
>
> Other specs on request.
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|