Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
Declare a string of size 15 and initialize it with the name 'Bob'.
Remember to use double quotes for string literals.
What is the purpose of the null terminator in strings?
Think about how C++ knows where a string ends.
Which function would you use to read an entire line of text including spaces?
Think about which option collects more information.
True or False: A string in C++ does not require a null character to terminate.
Recall the definition of a string.
Write a C++ program that reads a user's full name and outputs the number of characters (excluding spaces) in the name.
Keep track of the character count using a variable.
Create a program that accepts a string and checks if it is a palindrome (reads the same forwards and backwards).
Consider how you can use a for loop with indices.
4 more questions in this section. Enroll free to practise them all.
Enroll free