
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
Quick Quiz
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
Type answer...
33
Fill in the Blanks
Type answer...
34
Fill in the Blanks
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
53 questions
Chapter 4 (Lesson 10)
Presentation
•
University
48 questions
Robotics 2
Presentation
•
University
51 questions
User Behaviour Basics
Presentation
•
University
51 questions
Teaching strategies in developing creative thinking
Presentation
•
KG - University
46 questions
Information Systems Security
Presentation
•
University
47 questions
7.0 Introduction to Programming
Presentation
•
12th Grade - University
52 questions
SPANISH EXPLORATION LESSON AND ASSIGNMENT
Presentation
•
KG - University
Popular Resources on Wayground
15 questions
Grade 3 Simulation Assessment 1
Quiz
•
3rd Grade
22 questions
HCS Grade 4 Simulation Assessment_1 2526sy
Quiz
•
4th Grade
16 questions
Grade 3 Simulation Assessment 2
Quiz
•
3rd Grade
19 questions
HCS Grade 5 Simulation Assessment_1 2526sy
Quiz
•
5th Grade
17 questions
HCS Grade 4 Simulation Assessment_2 2526sy
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
24 questions
HCS Grade 5 Simulation Assessment_2 2526sy
Quiz
•
5th Grade
20 questions
Math Review
Quiz
•
3rd Grade
Discover more resources for Computers
36 questions
8th Grade US History STAAR Review
Quiz
•
KG - University
25 questions
Spanish future tense
Quiz
•
10th Grade - University
55 questions
Post Malone Addtion (Tres)
Quiz
•
12th Grade - University
15 questions
Quotation Marks vs. Italics for MLA
Quiz
•
9th Grade - University
20 questions
Disney Trivia
Quiz
•
University
50 questions
AP Biology Exam Review 2017
Quiz
•
11th Grade - University
215 questions
8th Physical Science GA Milestones Review
Quiz
•
KG - University
20 questions
Ch15_review_TEACHER
Quiz
•
University