Re: A simple program , need to see where's the mistake :)



Andrew Poelstra <apoelstra@xxxxxxxxxx> wrote:

int num, ctr;
scanf(&num);

What is this, my lord? Surely hell hath no fury like a terribly
incorrect scanf() call?

My final comment is that you shouldn't be using scanf() for user input,
as it's very unfriendly and doesn't handle erroneous input properly.
Better to write your own get_int() function using fgets() or fgetc(). I
recommend that as your next project.

And you helpfully provided an example of how *not* to use scanf() :-)

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
.



Relevant Pages

  • Re: A simple program , need to see wheres the mistake :)
    ... Surely hell hath no fury like a terribly ... incorrect scanf() call? ... Oops! ...
    (comp.lang.c)
  • Re: Borscht
    ... Ashkanazi Jews as a sub group of the population have the ... "Hell hath no fury ... ...
    (rec.food.cooking)
  • Re: Unnecessarily Weird Blade
    ... I always figured the most misquoted was, "Hell hath no fury like a ... "Heaven has no rage like love to hatred ... turned, Nor hell a fury like a woman scorned" from the play, ... Posted via a free Usenet account from http://www.teranews.com ...
    (rec.knives)
  • Re: 50 great hip-hop album covers
    ... Clipse - Hell Hath No Fury ... Organized Konfusion - Stress... ...
    (rec.music.hip-hop)
  • DO NOT EVER CROSSPOST TO ALT.USENET.KOOKS
    ... But you would say that, wouldn't you, Roger? ... Hell hath no fury like an imposter scorned. ... See the header. ...
    (rec.music.classical.recordings)