In: Computer Science
what is a const in C++?
what does const mean in these functions
-> " void idkwhattonameit( const name) {} "
-> " void idkwhattonameit2( const &name) {} "
-> " void idkwhattonameit3( const * name) {} "
-> " void idkagain (const unique_ptr < Name > name_uPtr)"
void idkwhattonameit( const name) {}
const name means the name parameter is used only for read only purpose.. we can't modify the name value but it will be no use if we use it on call by value
void idkwhattonameit2( const &name) {}
const name means the name parameter is used only for read only purpose.. we can't modify the name value but we can use it
void idkwhattonameit3( const * name)
here we made pointer as const than we can't change the address of variable name