xxxxxxxxxx
/* Method one */
typedef struct Vertex {
int x;
int y;
} Point;
/* Method two */
struct Vertex {
int x;
int y;
}
typedef struct Vertex Point;
xxxxxxxxxx
// C program to implement
// typedef with structures
#include <stdio.h>
#include <string.h>
typedef struct students
{
char name[50];
char branch[50];
int ID_no;
} students;
// Driver code
int main()
{
students st;
strcpy(st.name,
"Kamlesh Joshi");
strcpy(st.branch,
"Computer Science And Engineering");
st.ID_no = 108;
printf("Name: %s\n", st.name);
printf("Branch: %s\n", st.branch);
printf("ID_no: %d\n", st.ID_no);
return 0;
}