Pointer And Structure

in Hindi - Pointer And Structure



not yet

Source Code :

RUN#include <iostream.h>
#include <conio.h>

struct Employee{
   int emp_id;
   float emp_salary;
};
int main(){
    struct Employee *ptr,p;
   
    ptr=&p;
           
    cout<<"Enter Employee id: ";
    cin>>(*ptr).emp_id;
    cout<<"
Enter Employee salary: ";
    cin>>(*ptr).emp_salary;
    cout<<"
Employee id is "<<(*ptr).emp_id;
    cout<<"
Employee salary is "<<(*ptr).emp_salary;
   
return 0;
}