Results 1 to 2 of 2

Thread: int Initialization

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Answers
    1

    int Initialization

    What is the difference between following initialization
    int ivar1;
    int ivar2=int();


  2. #2

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact