Solved

clearing the input stack

Posted on 1997-06-07
1
193 Views
Last Modified: 2006-11-17
I want to clear the scanf input stack after it abort an input line because of an error. how do I do that (using ANSI C only)?
0
Comment
Question by:Amos060797
1 Comment
 
LVL 5

Accepted Solution

by:
julio011597 earned 30 total points
ID: 1251095
Maybe just read and discard (i.e. forget the input).
There's no way to clear the input stream other than reading it.

-julio
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
voltage to force translation ? 8 99
How to get time_t value that is a week old 6 169
Please explain C language error codes ? 5 26
windows 10 pro lost profile. 10 43
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question