Absolutely valid.
Usually, you can take full advantage of this way by defining two types together:
typedef struct
{
int a;
int b;
} S1, *S1PTR;
Where S1 is a struct and S1PTR is the pointer to this struct.
More Related Contents:
- Is there a way to use a typedef struct variable in a function…? [closed]
- C pointer to another struct
- typedef struct vs struct definitions [duplicate]
- self referential struct definition?
- Why should we typedef a struct so often in C?
- Pointer to pointer of structs indexing out of bounds(?) when I try to index anything other than zero
- How to define a typedef struct containing pointers to itself?
- Opaque C structs: various ways to declare them
- C: pointer to struct in the struct definition
- Passing a 2D array of structs
- What is ‘forward declaration’ and the difference between ‘typedef struct X’ and ‘struct X’?
- C Typedef and Struct Question
- C : typedef struct name {…}; VS typedef struct{…} name;
- Rationale behind the container_of macro in linux/list.h
- Why does “typdef struct { struct S *s; } S;” containing a pointer to same type compile?
- Are “malloc(sizeof(struct a *))” and “malloc(sizeof(struct a))” the same?
- How is the result struct of localtime allocated in C?
- Is typedef’ing a pointer type considered bad practice? [duplicate]
- How to include a dynamic array INSIDE a struct in C?
- Array of size 0 at the end of struct [duplicate]
- How to initialize a pointer to a struct in C?
- C Typedef – Incomplete Type
- dereferencing pointer to incomplete type
- Returning a struct pointer
- In C, is it good form to use typedef for a pointer?
- What is the output of the following code in C? [closed]
- Incorrect result in c code
- Can the size of pointers vary between data and function pointers?
- C – SizeOf Pointers
- Where in memory are string literals ? stack / heap? [duplicate]