How many ways are there to initialize an int with a constant?
Answer / nikhil upadhyay
Two.
There are two formats for initializers in C++ as shown in the example that follows. The first format uses the traditional C notation. The second format uses constructor notation.
int foo = 123;
int bar (123);
It's acceptable when a programmer does not know about the second notation, although they should certainly know about the first one. Many old-timer C programmers who made the switch to C++ never use the second idiom, although some wise heads of C++ profess to prefer it. If your applicant is quick with the right answer, that's a good sign.
Is This Answer Correct ? | 0 Yes | 0 No |
Explain the uses oof nested class?
Is c the same as c++?
How does work in c++?
What is an html tag?
What are register variables?
Where can I run c++ program?
Differentiate between a template class and class template?
What are the sizes and ranges of the basic c++ data types?
Define friend function.
What are friend functions?
What is a mutex and a critical section.Whats difference between them?How do each of them work?
What is the history of c++?