GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 15-Apr-2004, 06:43
fj8283888 fj8283888 is offline
Junior Member
 
Join Date: Apr 2004
Posts: 37
fj8283888 is on a distinguished road

struct


CPP / C++ / C Code:
typedef struct iorb {
    
        short base_pri;
        struct iorb *link;
        char filler[110];
        
        } IORB;
just want to know what is the difference between
CPP / C++ / C Code:
IORB *a,*b;  and
struct iorb *a,*b;

Thanks,
Frenk
Last edited by dsmith : 15-Apr-2004 at 09:52.
  #2  
Old 15-Apr-2004, 09:54
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light
Quote:
Originally Posted by fj8283888
CPP / C++ / C Code:
typedef struct iorb {
    
        short base_pri;
        struct iorb *link;
        char filler[110];
        
        } IORB;
just want to know what is the difference between
CPP / C++ / C Code:
IORB *a,*b;  and
struct iorb *a,*b;

Thanks,
Frenk

Hi Frenk.

Absolutely nothing to the compiler, less typing for the user on the first one. I can't remember for sure but I think typedef is a compiler directive so this gets replaced prior to compilation, just like a #define. Anyone know for sure?
  #3  
Old 15-Apr-2004, 13:31
machinated machinated is offline
Regular Member
 
Join Date: Mar 2004
Location: victoria, canada
Posts: 324
machinated has a spectacular aura aboutmachinated has a spectacular aura about
not sure, that typedef thing is c method in c++ you jus do this:

CPP / C++ / C Code:

struct iorb
{
   int a;
   int b;
   float a;
};

iorb *a , b;


p.s. i've never seen anyone using keyword struct while declaring a datatype of a structure.
 
 

Recent GIDBlogPython ebook by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent ! Pls Help Me ! mycashmoney C Programming Language 4 01-Jul-2006 23:49
some I/O problems...again cameron C++ Forum 3 03-Mar-2004 22:39
my compiler says I have to have a variable at the end of my structure ambeco C Programming Language 10 24-Feb-2004 11:37
compilation error cameron C++ Forum 18 20-Feb-2004 01:41
1st of the Month mike3340 C Programming Language 13 06-Feb-2004 12:57

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:49.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.