What is the difference between const and constexpr?

Answer Posted / glibwaresoftsolutions

• const: Value remains constant; evaluated at runtime.
• constexpr: Evaluated at compile time for optimization.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define friend function.

774


Comment on local and global scope of a variable.

868


What are the differences between new and malloc?

817


Write a short code using c++ to print out all odd number from 1 to 100 using a for loop

788


Differentiate between late binding and early binding.

945


Define the process of handling in case of destructor failure?

775


Explain the static member function.

919


What is a class template in c++?

770


Where and why do I have to put the "template" and "typename" keywords?

784


What is a node class in c++?

818


Differentiate between an external iterator and an internal iterator?

783


What are c++ data types?

869


When does a 'this' pointer get created?

819


What are the uses of typedef in a program?

806


Which field is used in c++?

819