C#, Java, and C++ Programming Concepts

Casual Mode - Take your time!

1 / 20
Correct
0
Incorrect
0
Score
0%
Multiple Choice

I have a function declaration like this(in C/C++).const int f(int* a){ ..... // Do something here return *a; }what is the purpose of the keyword const here?

  1. It is just a fancy keyword, No purpose here
  2. Prevents the compiler from assigning the function as an rvalue
  3. Prevents the compiler from assigning the function as an lvalue
  4. It makes sure that the return value is a const and is not changed by anyone else
Change Mode