-
Junior Member
int Initialization
What is the difference between following initialization
int ivar1;
int ivar2=int();
-
Junior Member
Re: int Initialization
hello,
In the first case, int ivar1, you are declaring the variable, by which you are telling the compiler about the type and size of variable.But you are not defining that variable.
But in the second case, You are declaring and defining the variable ivar2 in the same line. So the return value of the func. int() will be stored in to variable ivar2. While defining only compiler will allocate the memory for the variable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules