alexandradumit5105 alexandradumit5105
  • 03-02-2020
  • Computers and Technology
contestada

Assume that c is a char variable has been declared. Write some code that reads in the first character of the next line into c. Assume that the lines of input are under 100 characters long.

Respuesta :

frknkrtrn
frknkrtrn frknkrtrn
  • 04-02-2020

Answer:

cin.ignore(100,'\n') >> c;

Explanation:

In order to read data in C language, cin >> variable_name is used. In the question it is also asked that we should read until the next line, assuming the input is under 100 characters long.

If we use cin.ignore(100, '\n'), this will enable us to read until the next line. It will ignore first 100 character, and stop reading data when it reaches '\n' (in this case stopping criteria is being at the end of the line).

Answer Link

Otras preguntas

2 friends want to equally share 4/3 feet of rope.What length of rope should ea friend get?
What are the 4 main products for southeast
Why did populations soar between 1800 and 1900?
At a store , 24 bottles of water and 6 bags of chips costs $23.40. Five bottles of water and two bags of chips cost $6.60. What is the cost of a single bottle o
Use trig to solve for x show work
the perimeter of a square is 4 times as great as the length of any of its sides. Determine whether the perimeter of the square is proportional to the side lengt
next term in sequence 61, 122, 244, 488
Can someone help me in probability?Amanda wrote a computer program that generates two random numbers between one and eleven.When she runs it,what is the probabi
What is the slope of (2,3) , (6,7)
What is the Geocentric theory in your own words?