C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 21, Problem 21.18E
Program Plan Intro

Program Plan:

  • Include necessary header files.
  • Start “main()” function.
    • Declare two arrays to get input.
    • Use getline() function to get input in array “ a ”, with delimiter being ‘c’.
    • Use peek function to display next character in the input stream.
    • Use get() function to get input in array “ b ”, with delimiter being ‘c’.
    • Use peek function to display next character in the input stream.
    • Display both the strings entered.
    • Use strlen() function to calculate the length of input, add one to it and check if it is a null character. It will tell that if the string ends with null character or not.
  • Return an exit the program

Program Description:

The followingprogram checksfunctionality of getline() and get() function.

Blurred answer
Students have asked these similar questions
(True/False): The ReadConsole function reads mouse information from the input buffer
(Difficulty Level 3)Write a function frequency_match(text, chars) that receives a string text and a dictionary chars that has characters as keys and numbers as values. The function must return a list with all the characters that occur in the text as many times as their associated value in the char dictionary. Not all the chars in the text will be present in the dictionary, but you may assume that all the chars in the dictionary are in the text. You are allowed to change the values in the dictionary. solve using python
. (True/False): A segment selector points to an entry in a segment descriptor table
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning