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

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
Typedef Struct Pointer
Loading · ×Sorry to interrupt · Refresh More on forum.microchip.com
🌐 forum.microchip.com
C typedef and pointers to struct - Stack Overflow
Is it now a pointer type which I need to declare or just a pointer to _MY_STRUCT which I can use? I know that MY_STRUCT is a new type that needs to be used as follows: ... This is a common pattern from , a C header by the system implementor (who therefore can use _MY_STRUCT). In C++ you don't use typedefs ... More on stackoverflow.com
🌐 stackoverflow.com
c - typedef struct as pointer? - Stack Overflow
I have a question in regards to typedef struct's that I believe I know the answer to but would like some clarification. ... That is not the same. The second is a pointer. More on stackoverflow.com
🌐 stackoverflow.com
October 24, 2018

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
🌐
Cplusplus
cplusplus.com › forum › windows › 57382
Typedef struct with pointer - C++ Forum
December 11, 2011 - 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 type of the same structure.
🌐
Wikipedia
en.wikipedia.org › wiki › Typedef
typedef - Wikipedia
May 9, 2026 - 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.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › c language › typedef-in-c
C typedef - GeeksforGeeks
June 15, 2026 - 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 ...
🌐
Reddit
reddit.com › r/c_programming › [deleted by user]
[deleted by user] : r/C_Programming
April 21, 2023 - the trick here the type def must be complete before it is used where as only the struct name must exist to create the typedef
🌐
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.
🌐
YouTube
youtube.com › fred overflow
C typedef struct - YouTube
AboutPressCopyrightContact usCreatorsAdvertiseDevelopersTermsPrivacyPolicy & SafetyHow YouTube worksTest new featuresNFL Sunday Ticket · © 2025 Google LLC
Published: September 1, 2021
Views: 6K
🌐
Reddit
reddit.com › r/c_programming › passing a pointer to a typedef struct into a function?
r/C_Programming on Reddit: Passing a pointer to a typedef struct into a function?
March 15, 2021 -

I have a typedef struct in the main function which basically contains like 4 3d arrays of various data. it is basically the whole data for my program that gets generated on start.

I will have to read it maybe 2 function down the line. So I will pass it into one function and then maybe another and THEN I will use it. So I guess a pointer value is best for this. Problem is, structs aren't pointers but weird structures of contignuous memory or whatever. How to pass this massive thing inside a function? do I make a pointer to it? like:

void do_stuff_with_data(MY_STRUCT *data) {}
int main {
    MY_STRUCT data = generate_data();
    do_stuff_with_data(&data);
}

Any advice?

🌐
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 ·
🌐
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
🌐
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 ...
🌐
Stack Overflow
stackoverflow.com › questions › 33192742 › typedef-struct-pointers-correctly-pointing-to-typedef-struct-c
multithreading - Typedef struct pointers correctly pointing to typedef struct (C) - Stack Overflow
I am attempting to save a malloc'd ptr in a global ptr so I can use it in another function. Ideally I would a smarter data structure around the global, but for now I'm just trying to get the global ptr to work. In my lwp.h file I have the following definitions: typedef struct threadinfo_st *thread; typedef struct threadinfo_st { tid_t foo1 unsigned long foo2 size_t foo3 rfile foo4 thread foo5 thread foo6 thread foo7 thread foo8 } context;
🌐
TutorialsPoint
tutorialspoint.com › cprogramming › c_typedef.htm
Typedef in C
C - Pointers vs. Multi-dimensional Arrays ... The C programming language provides a keyword called typedef to set an alternate name to an existing data type. The typedef keyword in C is very useful in assigning a convenient alias to a built-in ...
🌐
James Madison University
w3.cs.jmu.edu › arch › crs › C › spat.html
struct, pointer, array, typedef
In a declaration statement, the symbol * adds pointer to to the type the declaration refers to. Note the symbol & is NOT used in declarations. A generic pointer (a pointer whose type matches any other pointer) is declared as follows. ... C has two types of collections. Structs are heterogenous collections and arrays are homogeneous collections.