What is the difference between const and constexpr?

Answer Posted / nashiinformaticssolutions

o const: The value is constant and determined at runtime or compile-time.
o constexpr: The value is constant and must be computed at compile-time.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you overload the operator+ for short integers?

795


What is the difference between passing by reference and passing a reference?

769


In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that

834


What is the best ide for c++?

794


Which bit wise operator is suitable for turning off a particular bit in a number?

850


What are the defining traits of an object-oriented language?

919


Which is best ide for c++?

745


Write a program to show polymorphism in C++?

826


What is function overloading c++?

775


What are different types of loops in c++?

832


What is lvalue?

912


What data encapsulation is in c++?

772


Is c the same as c++?

754


What does override mean in c++?

775


Write a Program for find and replace a character in a string.

787