Check out example codes for "typedef in c". It will help you in understanding the concepts better.

Code Example 1

typedef struct
  	//add different parts of the struct here
 	string username;
  	string password;
user; // name of struct - you can name this whatever

user example; //variable of type user

example.username = "Comfortable Caterpillar"; // username part of example variable
example.password = "password" // password part of example variable
if (user.username == "Comfortable Caterpillar")
	printf("upvote this if it helped!");

Code Example 2

#include <stdio.h>
#include <string.h>
typedef struct Books {
   char title[50];
   char author[50];
   char subject[100];
   int book_id;
} Book;
int main( ) {

   Book book;
   strcpy( book.title, "C Programming");
   strcpy(, "Nuha Ali"); 
   strcpy( book.subject, "C Programming Tutorial");
   book.book_id = 6495407;
   printf( "Book title : %s\n", book.title);
   printf( "Book author : %s\n",;
   printf( "Book subject : %s\n", book.subject);
   printf( "Book book_id : %d\n", book.book_id);

   return 0;

Learn ReactJs, React Native from