
C++ Strings
Presentation
•
Computers
•
University
•
Medium
Joshua Martinez
Used 1+ times
FREE Resource
39 Slides • 15 Questions
1
2
Multiple Choice
How many types of strings do we have in C++?
1
2
3
4
3
Multiple Choice
Which is TRUE about strings?
It is enclosed in single quotes
It has a fixed length
It is a collection of strings
It is a collection of characters
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Lecture on Strings
26
Multiple Choice
Which of the following is closest equivalent to the code below?
char str[] = "hello";
char str[10] = "hello";
char str[10] = {'h','e','l','l','o',\0'};
char str[10] = {'h','e','l','l','o'};
char str[6] = "hello";
27
Multiple Choice
What C String will be stored in the letterString after the following code is run?
char letterString[20] = "DoBeDo";
strcat(letterString, " to you");
DoBeDo
to you
DoBeDotoyou
DoBeDo to you
28
Multiple Choice
What is the output of the following code?
Hello
and Good bye
Hello and Good Bye
Compile Error
29
Multiple Choice
What should be done to make this code work?
Line 9: strcat(string_var[], " and Good Bye"
Line 10: cout << sting_var[];
Line 8: char string_var[20] = "Hello";
Line 9: string_var += " and Good Bye";
30
Multiple Choice
What is the maximum length of a string that can be placed in the c-string declared below?
char text[6];
4
5
6
7
31
Multiple Choice
What code will copy the string "hello" to the c-string declaration below?
char text[6];
text = "hello";
text[] = "hello";
strcpy(text,"hello");
strcat(text,"hello");
32
Fill in the Blanks
How many characters are there in 'n'?
Note: The answer must be numeric.
Type answer...
33
Fill in the Blanks
How many characters are there in '\n'?
Note: The answer must be numeric.
Type answer...
34
Fill in the Blanks
How many characters are there in "Josh"?
Note: The answer must be numeric.
Type answer...
35
Multiple Choice
Are the codes below equivalent?
char letters[] = "ABC";
char letters[] = {'A','B','C'};
Yes
No
36
Multiple Choice
Why are the codes below NOT equivalent?
char letters[] = "ABC";
char letters[] = {'A','B','C'};
The first is a c-string and the second is a string
The first is a cstring and the second is a character array
The first is a string and the second is a c-string
The first is a character array and the second is a c-string
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Multiple Choice
What is the output of the code given the input "Hello friend!"
Equal
Not Equal
54
Multiple Choice
What is the output of the code snippet?
Hello Hello
Jello Jello
Hello Jello
Jello Hello
Show answer
Auto Play
Slide 1 / 54
SLIDE
Similar Resources on Wayground
50 questions
DCS2103- Week 12 (Objects and Classes)
Presentation
•
University
51 questions
Bipolar Junction Transistor
Presentation
•
University
45 questions
Module 2 - Purposive Comm.
Presentation
•
University
51 questions
Abdominal Imaging 4th year
Presentation
•
University
48 questions
Simile and Metaphor- Lesson and Practice
Presentation
•
KG - University
48 questions
382352_2022
Presentation
•
University
50 questions
CE 11,12,13 Prinsip, Praktik, & Proses Pertahanan Jaringan
Presentation
•
University
48 questions
CS124 - Programming Language - Operators, Expressions and As
Presentation
•
University
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade
Discover more resources for Computers
20 questions
Disney Trivia
Quiz
•
University
10 questions
Spanish Greetings and Goodbyes!
Presentation
•
6th Grade - University
20 questions
Physical or Chemical Change/Phases
Quiz
•
8th Grade - University
39 questions
Unit 7 Key Terms
Quiz
•
11th Grade - University
25 questions
SER and Subject Pronouns
Quiz
•
8th Grade - University
38 questions
Unit 6 Key Terms
Quiz
•
11th Grade - University
19 questions
Key Concepts in Buddhism
Quiz
•
University
0 questions
Cell Domain Basic Review (Biology)
Quiz
•
University