🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.games.starcraft
Article #290137

Re: OK you code gurus...

#290137
From: Chris Mears
Date: Wed, 22 Mar 2006 00:25
28 lines
1999 bytes
Zealot The Crazy Lui <ktwils...@NOSPAM.comcast.net> writes:

> On Tue, 21 Mar 2006 16:13:09 -0800, Zealot The Crazy Lui
> <ktwils...@NOSPAM.comcast.net> wrote:
>
>>On Wed, 22 Mar 2006 11:06:35 +1100, Chris Mears <ch...@cmears.id.au>
>>wrote:
>>>How have you called getData?
>>
>>In the main method, yes. That's when it gets stuck.
>
> Of course I missed the "How"...
>
> getData( &n, &r );
> in the main method, n & r are unassigned but defined ints.

Thanks.

The particular error message you got ("Access violation writing location
0xe7430e45") suggests to me that scanf is trying to write to a pointer
you gave it but the pointer is wrong.  Can you find out which pointer
has the value 0xe7430e45?  Use printf("%p"...) to print the values of
the pointers n, r and scanString in getData().

It's possible that you are not passing the arguments on the stack in the
correct order.  If that's the case, scanf will be looking at one of the
integer pointers as a string, and anything could happen.  Try reversing
the order of the arguments on the stack.
Technical Details
Message-ID: <m3pskfwcj7.fsf@loki.cmears.id.au>
Path: mbox-mo1.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed-east.nntpserver.com!nntpserver.com!statler.nntpserver.com!news1.optus.net.au!optus!newsfeeder.syd.optusnet.com.au!news.optusnet.com.au!not-for-mail
References: <34a022ta3sjetnjnkvluulh8sajiq1t5ih@4ax.com> <m3y7z3wdf8.fsf@loki.cmears.id.au> <0k51221puq4bavvqjqm48ji2t6se21q4pn@4ax.com> <6n5122dpanan4h7l86cnkupkjf2pi0ffkl@4ax.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed-east.nntpserver.com!nntpserver.com!statler.nntpserver.com!news1.optus.net.au!optus!newsfeeder.syd.optusnet.com.au!news.optusnet.com.au!not-for-mail
Newsgroups: alt.games.starcraft
Subject: Re: OK you code gurus...
References: <34a022ta3sjetnjnkvluulh8sajiq1t5ih@4ax.com> <m3y7z3wdf8.fsf@loki.cmears.id.au> <0k51221puq4bavvqjqm48ji2t6se21q4pn@4ax.com> <6n5122dpanan4h7l86cnkupkjf2pi0ffkl@4ax.com>
From: Chris Mears <ch...@cmears.id.au>
Date: Wed, 22 Mar 2006 11:25:48 +1100
Message-ID: <m3pskfwcj7.fsf@loki.cmears.id.au>
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)
Cancel-Lock: sha1:gcEIhEzEAgv6tV8ogvUqZVGaXTo=
MIME-Version: 1.0
Lines: 28
NNTP-Posting-Host: 220.237.36.237
X-Trace: 1142987404  10673 220.237.36.237
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit