top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

In how many ways we can initialize an integer variable?

+1 vote
673 views
In how many ways we can initialize an integer variable?
posted Mar 27, 2014 by Manish Tiwari

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

We can initialize variables in C++ in two ways

Formal Way

int a = 2;

and Using construction notation

int a(2);
answer Mar 28, 2014 by Pavan P Naik
Similar Questions
+1 vote

I have just started learning PHP. So Can anyone tell me that How many methods are there to pass the variable through navigation between the different pages ?

+2 votes

I want to use the init_priority(prio) attribute
(https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html#C_002b_002b-Attributes)

to initialize stuff in my library early so that users of the library can use the library during their own static objects construction. However, my library uses standard C++ library facilities like std::string,
std::vector, etc. The question is:

What is the lowest priority for init_priority attribute that I can use to still have libstdc++ initialize itself before my library is initialized?

...