struct pointers

 #include <stdio.h>

#include <stdio.h>

#include<string.h>


struct emp{

    int id;

    char name[34];

    float salary;

};



int main() {

    struct emp e1;

    struct emp *ptr;

    ptr=&e1;

   // (*ptr).id=101;

ptr->id=101;

    printf("%d",e1.id);


    

    return 0;

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings