typedef fixed length array
Posted
by
Rajorshi
on Stack Overflow
See other posts from Stack Overflow
or by Rajorshi
Published on 2010-12-24T00:35:01Z
Indexed on
2010/12/24
0:54 UTC
Read the original article
Hit count: 174
Hi,
I have to define a 24-bit data type.I am using char[3]
to represent the type. Can I typedef char[3]
to type24
? I tried it in a code sample. I put typedef char[3] type42;
in my header file. The compiler did not complain about it. But when I defined a function void foo(type24 val) {}
in my C file, it did complain. I would like to be able to define functions like type24_to_int32(type24 val)
instead of type24_to_int32(char value[3])
.
© Stack Overflow or respective owner