Parameter Passing in C++

CS2 / C++

Authors

  • Victor Norman Calvin University

Abstract

The activity leads students to explore the 3 parameter passing mechanisms in C++, pass-by-value, pass-by-reference, and pass-by-const-reference, by exploring code using pythontutor.com in C++ mode. The students will discover how values can be passed into a function, strictly out of a function, and both in and out of a function. The activity will also have the students think about the efficiency of passing large data structures (large arrays or long strings) as parameters.

This activity was developed with NSF support through IUSE-1626765. You may request access to this activity via the following link: IntroCS-POGIL Activity Writing Program

  • Level: Undergraduates
  • Setting: Classroom with movable furniture
  • Activity Type: Learning Cycle
  • Discipline: Computer Science
  • Course: CS2 / C++
  • Keywords: C++, parameter passing, data structures.

Downloads

Published

2023-01-09

How to Cite

Norman, V. (2023). Parameter Passing in C++: CS2 / C++. POGIL Activity Clearinghouse, 3(4). Retrieved from https://pac.pogil.org/index.php/pac/article/view/352

Issue

Section

CS-POGIL Activity Writing Program