In C programming you can use the keyword typedef to define a reserve word once again according to you .
The C programming language provides a keyword called typedef, which is used to give a type, a new name.
typedef unsigned char BYTE;
After this declaration, the identifier BYTE can be used as abbreviation for the type unsigned char type variable.
By convention, uppercase letters are used for these to remind that the type name it is really a symbolic abbreviation, but you can use lowercase.
typedef unsigned char byte;
#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( book.author, "Introduction to Unix");
strcpy( book.subject, "Data Structure");
book.book_id = 6495407;
printf( "Book title : %s\n", book.title);
printf( "Book author : %s\n", book.author);
printf( "Book subject : %s\n", book.subject);
printf( "Book book_id : %d\n", book.book_id);
return 0;
}
0 Comment(s)