+ Reply to Thread
Results 1 to 3 of 3

Thread: Difference between declaration , definition & initialization

  1. #1
    Technical GURU BINNY is a name known to all BINNY is a name known to all BINNY is a name known to all BINNY is a name known to all BINNY is a name known to all BINNY is a name known to all BINNY's Avatar
    Join Date
    Feb 2006
    Location
    India
    Posts
    804
    Blog Entries
    2
    Rep Power
    18

    Difference between declaration , definition & initialization

    hi,

    Can any one tell me the correct difference between declaration , definition , initialization..
    BINNY

  2. #2
    Moderator GEEK will become famous soon enough GEEK will become famous soon enough GEEK's Avatar
    Join Date
    Nov 2006
    Age
    26
    Posts
    226
    Rep Power
    7

    Re: Difference between declaration , definition & initialization

    Great to see you again here BINNY !!!

  3. #3
    Junior Member vibs_im is on a distinguished road
    Join Date
    Jul 2007
    Location
    Pune
    Posts
    4
    Rep Power
    4

    Re: Difference between declaration , definition & initialization

    A declaration introduces a name – an identifier – to the compiler. It tells the compiler “This function or this variable exists somewhere, and here is what it should look like.”

    A definition, on the other hand, says: “Make this variable here” or “Make this function here.” It allocates storage for the name. This meaning works whether
    you’re talking about a variable or a function; in either case, at the point of definition the compiler allocates storage.

    extern const int x = 1; /* Initialization */
    This initialization establishes this as a definition, not a declaration.

    extern const int x; /* Declaration */
    This declaration in C++ means that the definition exists elsewhere.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Need .Net Interview Questions
    By vidyasagarkumar in forum VB / ASP.NET Technologies
    Replies: 7
    Last Post: 16-06-10, 03:40 PM
  2. Difference b/w Declaration and Definition
    By jithendra.b in forum ds. c , c++ Interview / Technical Questions
    Replies: 1
    Last Post: 04-06-07, 01:32 AM
  3. TCS Pacement paper 30
    By sridhar in forum TCS Placement Papers
    Replies: 0
    Last Post: 12-02-07, 05:45 PM
  4. TCS Pacement paper 29
    By sridhar in forum TCS Placement Papers
    Replies: 0
    Last Post: 12-02-07, 05:43 PM
  5. Replies: 0
    Last Post: 23-01-07, 01:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Content Relevant URLs by vBSEO 3.5.1 PL1