CSCI 3110
Algorithms and Data Structures
Syllabus
Calendar
Misc.
References Exercises
< Previous
Next >
Explain to your neighbor:
What a C++ reference is
What a C++ reference is not
When should a reference be used (as compared to a pointer)
What's the difference between (
e.g.
, what do the calls looks like):
int
complexAlgorithm1
(
int
*
input
);
int
complexAlgorithm2
(
int
&
input
);
Declare
str
as a
std::string
object
Declare
ex0
as a reference to
str
Assign
"A SQL query enters a restaurant, walks up to two tables and asks, 'Can I join you?'"
to
ex0
. What effect does this have?
Declare
ex1
as a reference to
ex0
. Explain to your neighbor what this does.
Assign
"I would tell you a UDP joke, but you might not get it"
to
ex1
. What effect does this have?
Write a function
ex8
that takes a
char
reference named pc, increments it and returns it
Write a function
ex9
that takes an
int
reference named num, and prints out the value of num and a message saying if num is odd or even
Last Modified: