LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   explain me this c code plz (https://www.linuxquestions.org/questions/programming-9/explain-me-this-c-code-plz-329869/)

alaios 06-03-2005 05:26 AM

explain me this c code plz
 
typedef u_long oid;
typedef u_char oid;
Can u explain me plz what the typedef means and what's the difference between u_long and u_char?
Thx a lot

trevelluk 06-03-2005 05:32 AM

The typedef statement just creates a new name for an existing type.
Those two statements will create a called oid which is the same as either a u_long or u_char. Presumably those two lines don't actually exist one after another in a source file?

As for the second question, u_long and u_char are both themselves created with typedefs from the standard C types unsigned long and unsigned char.


All times are GMT -5. The time now is 02:40 AM.