hello i m doing some function for saving a structure of some employee to text but i want to do it using ptrs to struct normally i tried first using ptr to struct in some main function to test some stuff abt it but i get runtime error
#include <stdio.h>
struct employee {
char SzName[100];
int age;
int payee;
};
int main(void)
{
struct employee *em1;
em1->age=12;
printf("%d\n",em1->age);
getchar();
return 0;
}
why do i get this runtime error ? its like doign *x=12 but with structures or do i get runtime error coz the ptr to struct isnt intilised ?but its alrdy intilised since struct employee *em1 should point to its aaddress or whats wrong ?