Skip to content

Files

Latest commit

014ed46 · Mar 28, 2023

History

History
This branch is 77 commits behind ShiqiYu/CPP:main.

week07

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 28, 2023
Mar 28, 2023
Mar 28, 2023
Mar 28, 2023
Oct 26, 2022
Oct 24, 2021

Chapter 7: Advances in Functions

Default arguments

Function overloading

Function templates

Recursion

Pointer to functions

Lab:

  • implement a function with default arguments.
  • overload a function which can compute the absolute value for an array, the array can be int, float and double

'''C++ vabs(int * p, int n); //should n be int or size_t, what's the difference, please create an arrary with more than 2^31 elements vabs(float * p, int n); vabs(float * p, int n); '''