_cgets() Problem

2»

Comments

  • [red]
    I find the conversation interesting, but you are right: it doesn't really help me solve my problem:
    Why does _cgets() fail? Or, if that cannot be answered:
    What function do I use for user input?

    Thanks for all the replies anyway... Guess Microsoft decided to 'expand' the C standard...

    Greets...
    Richard
    [/red]

    [green]
    Hey Richard, try this and see if it works. I read it somewhere on the net. By the way, fflush() wouldn't of worked anyways since _gets() is console input not stream so thats what lead me to this solution. I would still like to recommend using fgets(). In my opinion, it a far better choice to get input.

    [code]
    _cgets(buffer);
    _getch(); /* gets rid of the '
    ' according to what I have read */
    [/code]

    [/green]

  • : [red]
    : I find the conversation interesting, but you are right: it doesn't really help me solve my problem:
    : Why does _cgets() fail? Or, if that cannot be answered:
    : What function do I use for user input?
    :
    : Thanks for all the replies anyway... Guess Microsoft decided to 'expand' the C standard...
    :
    : Greets...
    : Richard
    : [/red]
    :
    : [green]
    : Hey Richard, try this and see if it works. I read it somewhere on the net. By the way, fflush() wouldn't of worked anyways since _gets() is console input not stream so thats what lead me to this solution. I would still like to recommend using fgets(). In my opinion, it a far better choice to get input.
    :
    : [code]
    : _cgets(buffer);
    : _getch(); /* gets rid of the '
    ' according to what I have read */
    : [/code]
    :
    : [/green]
    :
    :

    ...Actually, that doesn't work :-S
    I tried this code:
    [code]
    _getch();
    _getch();
    _cgets(buffer);
    _getch();
    _getch();
    [/code]
    Just to be sure, and it still seems to fail. This is the weirdest bug I have ever seen!
    I'll try something again later, because currently I am working on a different computer... Thanks for your help!

    Greets...
    Richard

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories