A structure Definition just behaves as a template
ex: Typedef stuct{
int emp_no;
int salary;
} EMP;
This is definition where no memory is allocated only it is defined
EMP e1;
This is declarartion where memory is allocated to a structure variable
Regards
Deepika
On Sat, 25 Dec 2004 just_a_watcher2005 wrote :
>
>
>
>Hi all,
>
>I post U.S. Yahoo forum first time from Japan.
>
>I read K&R book 'Language C' many years ago and had lost it
>somewhere.
>
>Yesterday I had a controversy with my colleague about
>meanings of 'definition' and 'declaration'.
>
>Here are some steps in which we battled.
>
>-----------------------------------------------
> 1|typedef struct _dog {
> 2| char name[20];
> 3| int age;
> 4| int color;
> 5| int favorite_food;
> 6|} DOG;
> 7|
> 8|DOG mydog;
> 9|DOG herdog;
>10|void main(int argc, char *argv[])
>11|{
>12| .
>-----------------------------------------------
>
>I said definition of DOG is the part of line 1 to 6 and
>declarations are line 8 and 9.
>But he alleged opposit things. "You're wrong. line 8 and 9
> are definitions, and 1-6 are declaration."
>
>I read books (in Japanese) about C/C++ regulations again
>... and found that .. ANSI and K&R seem to agree his thought.
>
>I can't beleave that definition can be twice and declaration can not.
>Definition is 'what is it?' and it should be unique.
>I want to advice ANSI to exchange its provisions right now.
>
>ES
>
>
>
>
>
>
>
>
>
>------------------------ Yahoo! Groups Sponsor --------------------~-->
>Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
>Now with Pop-Up Blocker. Get it for free!
>http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/EbFolB/TM
>--------------------------------------------------------------------~->
>
>To unsubscribe : [EMAIL PROTECTED]
>
>
>Yahoo! Groups Links
>
><*> To visit your group on the web, go to:
> http://groups.yahoo.com/group/Programmers-Town/
>
><*> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
><*> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
>
>
>
To unsubscribe : [EMAIL PROTECTED]
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To reply to this message, go to:
http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=4801
Please do not reply to this message via email. (more info)
- To visit your group on the web, go to:
http://groups.yahoo.com/group/Programmers-Town/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
