Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • TypeDef in C

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 71
    Comment on it

    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;
    }

     

    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: