1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Svetlanka [38]
4 years ago
11

_________function tells the cin object to skip one or more characters in the keyboard buffer.

Computers and Technology
1 answer:
Amanda [17]4 years ago
8 0

Answer:

cin.ignore function written as  cin.ignore()

Explanation:

  • As we know that cin is an object that is used to obtain the input entered by the user through the keyboard.
  • cin.ignore() is a function which is used to ignore or skip one or more characters in the keyboard buffer.
  • Keyboard buffer is a small storage area which is used to store keystrokes.
  • When a key is pressed on the keyboard it is referred to as a keystroke.
  • So before processing, these keystrokes are stored in keyboard buffer.
  • So when we use cin to input a character from the user through the keyboard, the keyboard buffer must be empty. If that's not done then the character entered will be taken by the buffer of previous variable.
  • Lets take an example of why we want to use cin.ignore() function.
  • For example you want the employee (user) to enter his name and you are using cin to read this name from the user.

                                          char empname[8];

                                           cin>>empname;

  • Now if the user types his name lets say Anonymous and press enter key this will be taken as new line character and it will store this newline character \n into the buffer.
  • cin >> statement reads data from the buffer and stops reading when it reaches newline character.
  • So Anonymous is read in and stored in empname variable but newline character is left in the keyboard buffer.                          
  • Lets say after cin>>empname we write another statement that takes a character from user. A user wants to enter character "a".

                                char character;

                            character = cin.get();

  • When cin.get finds the newline  character \n in keyboard buffer, it uses it (as cin.get can read the newline character in the buffer) without waiting for the  user to input "a".
  • So cin.ignore() function is used to avoid such situation.
  • We can specify the characters to be ignore within the cin.ignore() function such as cin.ignore(10,'\n') will ignore 10 characters in the buffer before taking new line or until a \n character comes.
  • You can simply use cin.ignore() which will ignore the very next character just as \n in our example. In our example we can use cin.ignore() after the cin>>empname; and before using cin.get();
You might be interested in
How many passes will it take to find the four in this list?
Vaselesa [24]
I don’t know what the heck is it true
3 0
3 years ago
Read 2 more answers
Tarikh Firoz Shahi who is writer please answer me​
igomit [66]

Answer:

Zia-ud Din Barni

Explanation:

Mark me Brainliest.

5 0
3 years ago
Read 2 more answers
Which block is an example of sequencing
Zepler [3.9K]

Answer:

B. go to x: -100 y: -100

   glide 2 secs to x: 0 y: 0

   say Let the show begin! for 2 secs

   play sound snap until done

Explanation:

Algorithms in computer programming are step-by-step processes that show how problems can be solved. To accomplish this, Sequencing, Selection, and Iteration are methods applied. Sequencing specifies the correct order in which activities are to be performed to obtain the right results. Failure to adhere to that order or reverse the steps will cause a deviation from the true result.

In the example above, the steps to perform an operation are specified to the computer. When the steps are correctly followed, the right results will be obtained.

8 0
3 years ago
How will you configure those computer hardware peripherals​
almond37 [142]

Answer:

i dont

Explanation:

know sorry tenks thankyou

8 0
3 years ago
Can someone help me on drawing ER and Use case diagram on following scenarios. ASAP!!! Please :(
GalinKa [24]

Answer:

The ER Diagram is in the attachment. And I an including the membership details in the use case:

Applicants: Coach will ask for iD.

if the application is not registered, coach sends to registration department.

Applicants registers-->> shows registration ID-->> goes to account section

Submits the fee->> goes to coach again-->>coach asks for fee sjip-->> On yes-->> entrance allowed else-->> sent to account section

Applicants apply for course-->>if prerequisite is met, registration allowed

else-->>registration denied

Note: If registration is allowed the applicant is sent to account section and

Also note:

First check, then registration, then course prerequisite check,then account->entrance

If registered->direct entry.

Explanation:

The answer is self explanatory.

4 0
4 years ago
Other questions:
  • PLEASE HELP!! In Tynker does anyone know how to do the physics cannon assignment?
    5·2 answers
  • PLEASE HELP!! HELP ME
    10·1 answer
  • Write a class named GasTank containing: An instance variable named amount of type double, initialized to 0. An instance variable
    13·1 answer
  • What is the name of the formal procedure scientists use to study the world around them?
    14·2 answers
  • Explain the importance of determinism in an industrial LAN
    8·1 answer
  • ________ is a programming language invented by netscape used to control the objects on an html page and handle interactions with
    5·1 answer
  • 2- (8 point) Write a program using the instructions below. Assume that integers are stored in 4 bytes. a) Define an array of typ
    10·1 answer
  • Write python code that does the following.
    13·1 answer
  • Which describes a set amount of pay received by a worker over the course of a year?
    6·2 answers
  • Slide rule was an analog device invented by William oughtred in 1620 it is true or false​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!