What is the difference between const and constexpr?
Answers were Sorted based on User's Feedback
Answer / nashiinformaticssolutions
• const: Value remains constant; evaluated at runtime.
• constexpr: Evaluated at compile time for optimization.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / 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 |
Answer / glibwaresoftsolutions
• const: Value remains constant; evaluated at runtime.
• constexpr: Evaluated at compile time for optimization.
| Is This Answer Correct ? | 0 Yes | 0 No |
• const: Value remains constant; evaluated at runtime.
• constexpr: Evaluated at compile time for optimization.
| Is This Answer Correct ? | 0 Yes | 0 No |
What does new in c++ do?
Explain how a pointer to function can be declared in C++?
Which of the Standard C++ casts can be used to perform a ?safe? downcast: a) reinterpret_cast b) dynamic_cast c) static_cast d) const_cast
What is the main purpose of overloading operators?
Explain the concept of friend function in c++?
Will rust take over c++?
What is difference between initialization and assignment?
12 Answers HCL, HP, Infosys,
What is std :: endl?
Refer to a name of class or function that is defined within a namespace?
Difference between class and structure.
How is modularity introduced in C++?
What is OOPs