Starting Out with C++: Early Objects (9th Edition)
Starting Out with C++: Early Objects (9th Edition)
9th Edition
ISBN: 9780134400242
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 12, Problem 1RQE

A(n)___________is represented in memory as an array of characters with a null terminator.

Expert Solution & Answer
Check Mark
Program Description Answer

C-string” is a series of characters that are stored in successive memory locations and it is terminated by a null character.

Explanation of Solution

C-string:

C-string is a series of characters that are stored in successive memory locations and it is terminated by a null character.

The ASCII code for the null character is 0, but in C++ and many programming languages it is represented by ‘\0’.

  • In a program, c-strings can be used in three forms. They are:
    • Programmer-defined arrays of character
    • Hard-coded string literals
    • Pointers to character
  • C++ language also provides some library functions to work with C-strings. Some of them are:
    • “strlen” function – This function helps to find the length of the string.
    • “strcat” function – By using this function, two or more than two strings can be concatenated.
    • “strcpy” function – This function is used to copy the string from one variable to another variable.
    • “strcmp” function – This function helps to compare strings.
  • In order to use C-string library functions, the header file “#include<cstring>” must be used.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Please help me in c++ program declare two characker arrays and takes thier input and add /0 at the end of both then store value of first char array in third array which terminates terminates array when reads /0 at end of first char array and start printing 2nd char array in same 3rd string and print /0 at the end of third string. Output: Enter first string: this is /0 Enter seond string: cat /0 third string: this is cat /0
AHPA #4: The C ATM Machine• Two people, "a" and "b", have checking and savings accounts.• Create a 2x2 array to hold their amounts: a – checking: $500, savings:$1,000; b – checking: $750, savings: $325.• Have the ATM machine ask the user their name.• Ask the user if they want to withdraw from their checking or their savingsaccount.• Use a switch statement to process different types of accounts.• Create  software that will provide an ATM user with theproper change for any dollar amount up to $200.• Example: Run the code for $19, $55, and $200. Is the amount > $100, then provide a $100 bill & subtract $100• Is the amount >= $100, then provide a $100 bill & subtract $100• Is the amount > $20, then provide a $20 bill & subtract $20 [repeat 4times]• Is the amount > $10, then provide a $10 bill and subtract $10• Is the amount > $5, then provide a $5 bill and subtract $5• Provide the remaining amount in single $1 bills   so the output should be like shown in…
Time remaining: 01:59:44 Computer Science //Change the code so that it is a "DataStore with Vectors & 3-files" #include <iostream>using namespace std;int main(){   int n;   cout << "How Many: ";   cin >> n;      double *pScore = new double[n];     for (int x = 0; x < n; x++)   {       cout << "Enter Score: ";       cin >> pScore[x];   }   for (int x = 0; x < n; x++)       cout << pScore[x] << " " << &pScore[x] << endl;   return 0; }

Chapter 12 Solutions

Starting Out with C++: Early Objects (9th Edition)

Ch. 12.3 - Prob. 12.11CPCh. 12.3 - Prob. 12.12CPCh. 12.4 - What is the output of the following program?...Ch. 12 - A(n)___________is represented in memory as an...Ch. 12 - The____________ statement is required before the...Ch. 12 - A(n)____________is written in your program as a...Ch. 12 - Prob. 4RQECh. 12 - The______________ is used to mark the end of a...Ch. 12 - Prob. 6RQECh. 12 - Prob. 7RQECh. 12 - Prob. 8RQECh. 12 - Prob. 9RQECh. 12 - Prob. 10RQECh. 12 - Prob. 11RQECh. 12 - Prob. 12RQECh. 12 - Prob. 13RQECh. 12 - Prob. 14RQECh. 12 - Prob. 15RQECh. 12 - Prob. 16RQECh. 12 - Prob. 17RQECh. 12 - Prob. 18RQECh. 12 - Write a function whose prototype is char...Ch. 12 - #inc1ude iostream using namespace std; int main()...Ch. 12 - #include iostream using namespace std; int main()...Ch. 12 - #include iostream using namespace std; int main()...Ch. 12 - #inc1ude iostream #inc1ude string using namespace...Ch. 12 - #inc1ude iostream #inc1ude cstring using namespace...Ch. 12 - #inc1ude iostream using namespace std; int main()...Ch. 12 - #inc1ude iostream #inc1ude string using namespace...Ch. 12 - #include iostream #inc1ude cstring using namespace...Ch. 12 - #include iostre4m #inc1ude cstring using namespace...Ch. 12 - Each of the following programs or program segments...Ch. 12 - Soft Skills 30. You are a member of a...Ch. 12 - Prob. 1PCCh. 12 - Prob. 2PCCh. 12 - Prob. 3PCCh. 12 - Prob. 4PCCh. 12 - Name Arranger Write a program that asks for the...Ch. 12 - Prob. 6PCCh. 12 - Prob. 7PCCh. 12 - Prob. 8PCCh. 12 - Prob. 9PCCh. 12 - Password Verifier Imagine you are developing a...Ch. 12 - Prob. 11PCCh. 12 - Check Writer Write a program that displays a...Ch. 12 - Prob. 13PCCh. 12 - Dollar Amount Formatter Modify Program 12-13 by...Ch. 12 - Word Separator Write a program that accepts as...Ch. 12 - Prob. 16PCCh. 12 - I before e except after c A friend of yours who is...Ch. 12 - User Name Write a program that queries its...Ch. 12 - String Splitter Write a function vectorstring...Ch. 12 - Palindromic Numbers A palindromic number is a...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
1.1 Arrays in Data Structure | Declaration, Initialization, Memory representation; Author: Jenny's lectures CS/IT NET&JRF;https://www.youtube.com/watch?v=AT14lCXuMKI;License: Standard YouTube License, CC-BY
Definition of Array; Author: Neso Academy;https://www.youtube.com/watch?v=55l-aZ7_F24;License: Standard Youtube License