Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

what does typedef emun mean?

Status
Not open for further replies.

Terminator Electricity

Member level 5
Joined
Feb 2, 2006
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,973
what does typedef mean

Hi what does this statement mean ?

typedef enum {
RC5_0 = 0,
RC5_1 = 1,
RC5_X = 2 /* no emission */
} RC5_EMIT;

what does enum mean from the first place ? is it a structure?
 

what does typedef

enum is a data type in C, not a structure.
the code define a new data type "RC5_EMIT" and have the same meaning of
"enum{ RC5_0=0, RC5_1=1,RC5_X=2}".

Ryan
 

Thanks alot for help ,,

I have some other questions if u dont mind

static const char *StateName[] : what sense does declaring the array as a pointer gives ? isnt the array already a pointer ?????!!!!
what does declaring a const char means ?

Thanks
 

Pointers to arrays are used in multidimensional arrays.
 

The array is a pointer, and it point to a constant char. The char can not change, it is constant, so using const char definition.

Ryan
 

Like this:

Code:
const char *strings[] = 
{
"String one",
"String two",
"String three"
};

printf("%s", strings[0]);

prints String one

strings[0] = "String one", strings[1] = "String two" and strings[2] = "String three"

static is a scoping rule. The array can only be seen in the current file.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top