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]
3 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]3 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
Match the following:
mash [69]

Answer:

a:1, b:4, c:5, d:2, e:3

3 0
3 years ago
To find out how much ram is installed on a machine, in windows go to the user: a power ______ is a part inside a computer case t
shusha [124]
<span>a power _supply_ is a part inside a computer case that supplies power to the motherboard and other devices that are installed user: when a hard drive is first recognized by windows, it is assigned the _basic_ disk status user: utilize a _64_-bit os if you are looking for increased performance and you have a system that can support it.</span>
4 0
2 years ago
Handhed computer is otherwise called as<br> 1.laptop<br> 2.Notebook<br> 3.Palmtop
NikAS [45]

Answer:

personal digital assistants (PDAs)palmtop

3 0
3 years ago
NEED HELP ASAP!!!
Triss [41]

Answer:

Feet & Inches

4). Millimeters

5). Pixels

3 0
2 years ago
Adam is using the software development life cycle to create a new game. He made an outline of what functionality the game will r
Olin [163]

Answer:

Write pseudocode and create a mock-up of how the game will work and look

Explanation:

Since in the question it is mentioned that Adam wants to develop a new game for this he made an outline with respect to game functions needed, time period, people who help him.

After that, he writes the pseudocode i.e a programming language and then develops a model i.e mock up that reflects the working of the game and its look so that he would get to know how much work is pending.

3 0
3 years ago
Other questions:
  • Kim is creating a one-page presentation in Word about her parents’ home country, Vietnam. She has inserted images that are each
    7·2 answers
  • Sugar can be listed in many different forms except
    9·1 answer
  • The main characteristic of ____ is that its source code is published with the software.
    7·1 answer
  • What does the CPU do in a computer?
    7·2 answers
  • Which 2 processes are operational processes
    10·1 answer
  • Please help me on this please i am giving all of my points so please help me
    6·1 answer
  • A tech class question any help will be greatly apprieciated
    10·1 answer
  • Int value[10] = {1, -7, 95, 123, 80, 67, -30, 17, 152, 121} ;
    12·1 answer
  • GUYS THERE IS A HACKER IN BRAINLY PLEASE DONT PRESS ON THE WEBSITE THEY WILL HACK YOU.
    9·2 answers
  • Maria is conducting a security investigation and has identified a suspect. The suspect is an employee of the organization who ha
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!