The typedef would be
typedef char type24[3];
However, this is probably a very bad idea, because the resulting type is an array type, but users of it won’t see that it’s an array type. If used as a function argument, it will be passed by reference, not by value, and the sizeof
for it will then be wrong.
A better solution would be
typedef struct type24 { char x[3]; } type24;
You probably also want to be using unsigned char
instead of char
, since the latter has implementation-defined signedness.
Related Posts:
- How to initialize array to 0 in C?
- How to properly malloc for array of struct in C
- difference between
and - Convert char array to a int number in C
- Warning/error “function declaration isn’t a prototype”
- Returning an array using C
- warning: initializer element is not computable at load time
- How to copy a char array in C?
- Why do I get “cast from pointer to integer of different size” error?
- C subscripted value is neither array nor pointer nor vector when assigning an array element value
- struct has no member named
- Initializing array of structures
- How to empty a char array?
- What is the difference between array and enum in C ?
- Undefined reference to main – collect2: ld returned 1 exit status
- Can I create an Array of Char pointers in C?
- Excess elements of scalar initializer for pointer to array of ints
- Where is the
header file on Linux? Why can’t I find ? - How to allocate array of pointers for strings by malloc in C?
- How to solve static declaration follows non-static declaration in GCC C code?
- C: warning: excess elements in array initializer; near initialization for ‘xxx’ ; expects ‘char *’, but has type ‘int’
- Pointer to 2D arrays in C
- Initializing 2D char array in C
- GCC: Array type has incomplete element type
- How do I check if a string contains a certain character?
- uint8_t vs unsigned char
- typedef struct vs struct definitions [duplicate]
- Why should we typedef a struct so often in C?
- Why should we typedef a struct so often in C?
- typedef struct vs struct definitions [duplicate]
- How do I determine the size of my array in C?
- dereferencing pointer to incomplete type
- char *array and char array[]
- How do I create an array of strings in C?
- Convert char to int in C and C++
- “Expected expression before ‘ { ‘ token”
- C pointers and arrays: [Warning] assignment makes pointer from integer without a cast
- How to print the array?
- “error: assignment to expression with array type error” when I assign a struct field (C)
- Getting “conflicting types for function” in C, why?
- How do you make an array of structs in C?
- what is stack smashing (C)?
- Getting “conflicting types for function” in C, why?
- Is there a function to copy an array in C/C++?
- warning: incompatible implicit declaration of built-in function ‘xyz’
- How do I create an array of strings in C?
- Return char[]/string from a function [duplicate]
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- Why am I getting “array initializer must be an initializer list or string literal”?
- What does ** do in C language?
- Using Dynamic Memory allocation for arrays
- How do I create an array of strings in C?
- conflicting types error when compiling c program using gcc
- What is a file with extension .a?
- How to make an array with a dynamic size? General usage of dynamic arrays (maybe pointers too)?
- Finding the length of a Character Array in C
- Return char[]/string from a function
- gcc/g++: “No such file or directory”
- What’s the syntax for declaring an array of function pointers without using a separate typedef?
- How to print a char array in C through printf?
- How to clear all the elements of array in C?
- Zero an array in C code
- Passing an array by reference in C?
- Excess elements in char array initializer error
- waitpid, wnohang, wuntraced. How do I use these
- How to do scanf for single char in C
- Sign extend a nine-bit number in C
- Warning: assignment from incompatible pointer type
- Break statement not within loop or switch in C
- How to create an array of strings in C?
- C++ array assign error: invalid array assignment
- Cache Simulator in C
- C: error: expected ‘)’ before ‘;’ token
- Where is the C auto keyword used?
- make: Nothing to be done for `all’
- (.text+0x20): undefined reference to `main’ and undefined reference to function
- Initialization from incompatible pointer type warning when assigning to a pointer
- Typedef function pointer?
- I’m getting “Invalid Initializer”, what am I doing wrong?
- Data argument not used by format strings in C
- execv vs execvp, why just one of them require the exact file’s path?
- expected expression before ‘{‘ token
- Setting std=c99 flag in GCC
- C Vector/ArrayList/LinkedList
- Bind failed: Address already in use
- Error: initializer element is not computable at load time
- What is the difference between %f and %lf in C?
- Debug vs Release in CMake
- What is stdin in C language?
- Debug vs Release in CMake
- How to prevent multiple definitions in C?
- How to pass 2D array (matrix) in a function in C?
- error: ‘for’ loop initial declarations are only allowed in C99 mode [duplicate]
- How can you print multiple variables inside a string using printf?
- c – warning: implicit declaration of function ‘printf’
- Flushing buffers in C
- What are 0x01 and 0x80 representative of in C bitwise operations?
- Convert char array to string use C
- How to make parent wait for all child processes to finish?
- Undefined Reference issues using Semaphores