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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c++ support multilevel and multiple inheritances?

948


How would you use the functions randomize() and random()?

1022


What are the c++ access specifiers?

1342


What is the full name of logo?

1064


Explain the operation of overloading of an assignment operator.

1106


What are the advantages of using pointers in a program?

1093


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

909


How should runtime errors be handled in c++?

1084


Difference between inline functions and macros?

974


Differentiate between declaration and definition.

982


Please explain the reference variable in c++?

1019


Is swift faster than c++?

958


If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?

1058


Explain what are single and multiple inheritances in c++?

974


When should I use unitbuf flag?

969