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
🌐
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]);
Discussions

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. 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
Typedef Struct Pointer
Loading · ×Sorry to interrupt · Refresh More on forum.microchip.com
🌐 forum.microchip.com
Typedef struct with pointer - C++ Forum
This is done because in C you are required to use the struct keyword when declaring variables. Example: So that justifies the first typedef (the one that defines PAINTSTRUCT in your example). With the typedef you can just omit the keyword. The other name, PPAINTSTRUCT in your example, is just a declaration of a pointer ... More on cplusplus.com
🌐 cplusplus.com
December 11, 2011

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
3 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.
🌐
Reddit
reddit.com › r/c_programming › [deleted by user]
typedef a struct with a pointer to itself : r/C_Programming
April 21, 2023 - Yes, I did include that in “Possible ways to solve this: …”, but question is about unnamed structs, it seems impossible to do the same without creation of struct along the way, is it really is? ... Yes, it's impossible to do with unnamed structs. There are two ways to do it: // Separate struct and typedef, with typedef first typedef struct ingenius_t ingenius_t; struct ingenius_t { int a; ingenius_t *b; // OR struct ingenius_t *b; }; // Combine struct and typedef typedef struct ingenius_t { int a; struct ingenius_t *b; } ingenius_t;
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 ·
🌐
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.
🌐
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
🌐
James Madison University
w3.cs.jmu.edu › arch › crs › C › spat.html
struct, pointer, array, typedef
So if in Java you have a node class, node variables store pointers to node objects. In C, the pointer nature of the reference is explicit. typedef struct nn { int value; struct nn *next; } node; node *top; node *pp; pp = top; while (pp != NULL) { printf ("%d\n", (*pp).value); pp = (*pp).next; }
🌐
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 ...
🌐
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 ...
🌐
Quora
quora.com › Why-can’t-I-declare-a-pointer-members-type-of-a-struct-by-using-the-structs-typedef-name
Why can’t I declare a pointer member's type of a struct by using the struct's typedef name? - Quora
Answer (1 of 4): A few problems. To declare a [code ]struct[/code] type, you need the word [code ]struct[/code]. Second, in the [code ]struct[/code] itself, you refer to the type name, which hasn’t been declared yet. Consider the following: [code]typedef struct BTnode BTNodeT; struct BTNode { ...
🌐
Fresh2Refresh
fresh2refresh.com › home › c programming tutorial › c – typedef
C typedef example program - Complete C tutorial
September 22, 2020 - Typedef is a keyword that is used to give a new symbolic name for the existing name in a C program. This is same like defining alias for the commands. Consider the below structure. struct student { int mark [2]; char name [10]; float average; } Variable for the above structure can be declared ...
🌐
Stack Overflow
stackoverflow.com › questions › 52969972 › typedef-struct-as-pointer
c - typedef struct as pointer? - Stack Overflow
October 24, 2018 - For typedef the asterisk means "define as pointer", just like it does for variables. ... Sign up to request clarification or add additional context in comments. ... The type definitions are usually in a header file where no vars are created.
🌐
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
🌐
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").
🌐
GeeksforGeeks
geeksforgeeks.org › c language › typedef-in-c
C typedef - GeeksforGeeks
July 23, 2025 - Explanation: In this code, typedef is used to define an alias stu for the structure Students. The alias simplifies declaring variables of this structure type, such as st. The program then initializes and prints the values of the structure members ...
🌐
guvi.in
studytonight.com › c › typedef.php
typedef Keyword in C Programming
By this declaration statement, we are actually declaring x as a pointer of type int, whereas y will be declared as a plain int variable. ... But if we use typedef like we have used in the example above, we can declare any number of pointers in a single statement.