IT Community - Software Programming, Web Development and Technical Support

Differenciate the below codes

This is a discussion on Differenciate the below codes within the C and C++ Programming forums, part of the Software Development category; Hi, What's the difference between these two declarations? struct x1 { ... }; typedef struct { ... } x2; Thanks, Prasath.K...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-18-2007, 02:44 AM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Smile Differenciate the below codes

Hi,

What's the difference between these two declarations?

struct x1 { ... };
typedef struct { ... } x2;



Thanks,
Prasath.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-18-2007, 12:49 AM
Venkat Venkat is offline
D-Web Master
 
Join Date: Mar 2007
Posts: 350
Venkat is on a distinguished road
Thumbs up Re: Differenciate the below codes

hey,

The first structure is named by a tag, the second by a typedef name.
__________________
Venkat
knowledge is Power
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-29-2007, 03:40 AM
seesamjagan seesamjagan is offline
D-Web Programmer
 
Join Date: Aug 2007
Location: Chennai
Posts: 66
seesamjagan is on a distinguished road
Send a message via AIM to seesamjagan Send a message via Yahoo to seesamjagan
Thumbs up Re: Differenciate the below codes

In the first code if you want to create a variable(s) of type x1 you should use the following notation

struct x1 a,b,c;

where as in the second example to create a variable(s) of type x2 you can use the shortest notation like the following since it is a typedef

x2 a,b,c
__________________
SeeSamJagan
- Sky is not the "LIMIT", Death is not the END, There is still something beyond....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HALLOWEEN SPECIAL - one day only - 25 coupon codes to save 40% a life long >> Webdomain.com Web Hosting Deals 1 10-10-2008 06:02 PM
How to execute codes when TWO keys are pressed in Flash aramesh Flash Actionscript Programming 1 08-16-2007 02:44 AM


All times are GMT -7. The time now is 11:25 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0