94
submitted 1 week ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 5 points 1 week ago

typedef in C just make an alias to the same type. structs have nominal typing though:

// this typedef is optional to avoid having to refer to the struct tag when referencing the types
typedef struct {int} t_0;
typedef struct {long} t_1;

t_0 test() {
  t_1 foo = {1};
  return foo; // error
}
this post was submitted on 11 Jul 2025
94 points (100.0% liked)

Linux

8484 readers
540 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of [email protected] and The GIMP

founded 2 years ago
MODERATORS