Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How many ways are there to initialize an int with a constant?



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

Post New Answer

More C++ General Interview Questions

What is "mutable" keyword?

2 Answers   Infosys, Teradata,


What does new return if there is insufficient memory to make your new object?

0 Answers  


List out some of the OODBMS available?

1 Answers  


What does it mean to declare a member variable as static?

0 Answers  


What does n mean in c++?

0 Answers  


Mention the purpose of istream class?

0 Answers  


Describe run-time type identification?

1 Answers  


Does defining a function inline mean that it wont push and pop things on/off the stack ...like parameters and the return the address??

2 Answers  


Write a c program for binary addition of two 8 bit numbers.

0 Answers   TCS,


Write any small program that will compile in "C" but not in "C++"?

4 Answers  


What is #include c++?

0 Answers  


What is the full name of logo?

0 Answers  


Categories