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.

Answer from alexkr on Stack Overflow

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.

Answer from alexkr on Stack Overflow
🌐
Wikipedia
en.wikipedia.org › wiki › Typedef
typedef - Wikipedia
2 weeks ago - Here both C as well as C++ need the struct keyword in the parameter definition. The typedef may be used to define a new pointer type.
Discussions

Typedef Struct Pointer
Loading · ×Sorry to interrupt · Refresh More on forum.microchip.com
🌐 forum.microchip.com
Typedef struct with pointer - C++ Forum
Hi all, what does it mean, that after a typedef struct, after the custom name for it, there is also a pointer? Heres an example: I know why PAINTSTRUCT is there, but what is *PPAINTSTRUCT doing there? Ty in advance! More on cplusplus.com
🌐 cplusplus.com
December 11, 2011
c - typedef struct pointer definition - Stack Overflow
I know that edgeitem and edge are tags and I can use struct edge *next but I declared the pointers so how come i can't use them? ... It is generally considerd bad style to hide a '*' behind a typedef. It can only lead to confusion. Programmers read *thing faster than pThing. The same goes for other syntax elements, such as #define AND &&, et cetera. In ... More on stackoverflow.com
🌐 stackoverflow.com
[deleted by user]
typedef struct Ingenious { int32_t A; Ingenious *B; } Ingenious; _t is reserved by POSIX, don’t use non-stdint types, and most importantly there’s two name fields in the definition of a struct, the first and last (one is called a tag and I forget the other name but it’s not important) C requires only the last name for structs, but if you want a recursive structure, you must name the first field and use that to refer to it’s self. More on reddit.com
🌐 r/C_Programming
9
3
April 21, 2023
🌐
Educative
educative.io › blog › how-to-use-the-typedef-struct-in-c
How to use the typedef struct in C
May 19, 2025 - Here, typedef is the keyword used to create an alias for an existing type, return_type indicates the return type of the function that the pointer will point to, (*alias_name) for the function pointer, the * indicates that this is a pointer to ...
🌐
HowStuffWorks
computer.howstuffworks.com › tech › computer software › programming
Pointers to Structures - The Basics of C Programming | HowStuffWorks
March 8, 2023 - If an array of the structures had been created instead, 243 * 10 = 2,430 bytes would have been required for the array. Using the array of pointers allows the array to take up minimal space until the actual records are allocated with malloc statements. The code below simply allocates one record, places a value in it, and disposes of the record to demonstrate the process: typedef struct { char s1[81]; char s2[81]; char s3[81]; } Rec; Rec *a[10]; a[0] = (Rec *)malloc(sizeof(Rec)); strcpy(a[0]->s1, "hello"); free(a[0]);
🌐
Cplusplus
cplusplus.com › forum › windows › 57382
Typedef struct with pointer - C++ Forum
December 11, 2011 - So i actually declare two things, specifically, PAINTSTRUCT is the name (typedef) of a tagPAINTSTRUCT and additionally in this example, PAINTSTRUCT is the name (typedef) of a pointer to a tagPAINTSTRUCT, right? ... No, note the extra P at the beginning of PPAINTSTRUCT. If you change your phrase "PPAINTSTRUCT is the name (typedef) of a pointer to a tagPAINTSTRUCT", then yes, you're right.
Find elsewhere
🌐
Toronto
eecg.toronto.edu › ~amza › ece106h1s › LECTURES › pointers-2.pdf pdf
Structures typedef
cout << i << endl; } Page 16 · How about pointers inside structs ? How about pointers inside structs ? typedef struct · typedef struct four_chars { four_chars { char · char · first_char; first_char; char · char · second_char; second_char; … · … · … char ·
🌐
Reddit
reddit.com › r/c_programming › [deleted by user]
typedef a struct with a pointer to itself : r/C_Programming
April 21, 2023 - If you separate them and write the typedef before the struct definition, you have the option to use the struct ingenius_t type or the ingenius_t typedef name inside the struct definition because both are known to the C compiler at that point.
🌐
Cprogramming
cboard.cprogramming.com › c-programming › 125434-pointer-typedef-struct.html
Pointer to a typedef struct
April 2, 2010 - Pointer to a typedef struct · Show Printable Version · Email this Page… · Subscribe to this Thread… · Linear Mode · Switch to Hybrid Mode · Switch to Threaded Mode · 04-02-2010 #1 · james007 · View Profile · View Forum Posts Registered User · Join Date · Apr 2010 · Posts · 4 · Hi, Please help me with this C syntax. I get a incompatible type warning with this: typedef struct{ unsigned char a; unsigned char b; unsigned char c; } TEST; void main(void) { unsigned char *pointer; TEST Test; pointer = &Test; } What I tried to do there is to get the address of "Test".
🌐
Swarthmore College
cs.swarthmore.edu › ~newhall › cs31 › resources › C-structs_pointers.php
CS31: Intro to C Structs and Pointers
See struct.c for more examples. Exercise: implement and test two functions in this file: printStudent and initStudent. C pointer variables A pointer variable stores the address of a memory location that stores a value of the type to which it points ("a level of indirection").
🌐
James Madison University
w3.cs.jmu.edu › arch › crs › C › spat.html
struct, pointer, array, typedef
typedef int age; typedef char line[80]; After the definitions above, the following are equivalent. When arrays are declared as formal parameters, they work like dynamic arrays. The reference is being passed as the parameter, not the array itself. The formal parameter serves as an alias for the actual argument. Thus it can be declared to be a popinter, just as array aliases where declared as pointers in the example above.
🌐
SEI CERT
wiki.sei.cmu.edu › confluence › display › c › DCL05-C.+Use+typedefs+of+non-pointer+types+only
DCL05-C. Use typedefs of non-pointer types only - SEI CERT C Coding Standard - Confluence
"Using typedef to define a pointer type makes const correctness more difficult to achieve, less obvious, or inconsistent." A disadvantage of using typdefs for structs is that finding the full declaration of a struct with tools such as cscope or
🌐
Arduino Forum
forum.arduino.cc › projects › programming
typedef struct pointer - Programming - Arduino Forum
November 18, 2017 - is there a reason why all c compilers have no problem with declaring header_file.h typedef struct Program_Data_Struct *Program_Data_Struct; while arduino spits out the error: error: conflicting declaration 'typedef struct Program_Data_Struct * Program_Data_Struct' typedef struct Program_Data_Struct ...
🌐
Programiz
programiz.com › c-programming › c-structures-pointers
C structs and Pointers (With Examples)
Here's how you can create pointers to structs. struct name { member1; member2; . . }; int main() { struct name *ptr, Harry; }
🌐
Fresh2Refresh
fresh2refresh.com › home › c programming tutorial › c – typedef
C typedef example program - Complete C tutorial
September 22, 2020 - typedef struct student { int mark [2]; char name [10]; float average; } status;
🌐
cppreference.com
en.cppreference.com › cpp › language › typedef
typedef specifier - cppreference.com
// simple typedef typedef unsigned long ulong; // the following two objects have the same type unsigned long l1; ulong l2; // more complicated typedef typedef int int_t, *intp_t, (&fp)(int, ulong), arr_t[10]; // the following two objects have the same type int a1[10]; arr_t a2; // beware: the following two objects do not have the same type const intp_t p1 = 0; // int *const p1 = 0 const int *p2; // common C idiom to avoid having to write "struct S" typedef struct { int a; int b; } S, *pS; // the following two objects have the same type pS ps1; S* ps2; // error: storage-class-specifier cannot a
🌐
guvi.in
studytonight.com › c › typedef.php
typedef Keyword in C Programming
typedef struct { type member1; type member2; type member3; } type_name; Here type_name represents the stucture definition associated with it. Now this type_name can be used to declare a variable of this stucture type.