S
seema
I have a struct and I want to access its values, I am new to pointers
so I have written something like this,
# define COLLATE "Beetle"
struct mytips
{
short inverse;
long mass;
char *c;
char *m;
};
int main(){
struct mytips store[10] = {
{0,0x00000001L,COLLATE,"playing one"},
{0,0x00000002L,COLLATE,"playing two"},
{0,0x00000004L,COLLATE,"playing three"},
{0,0x00000008L,COLLATE,"playing four"},
{0,0x00000008L,COLLATE,"playing five"},
{0,0x00000008L,COLLATE,"playing six"},
};
void *dinku;
dinku=(struct mytips*)malloc((sizeof(char)*sizeof(store))+1);
}
Now how can I access the values of store using void pointer? Can
somebody explaing
how to do it
Thanks in advance,
Seema
so I have written something like this,
# define COLLATE "Beetle"
struct mytips
{
short inverse;
long mass;
char *c;
char *m;
};
int main(){
struct mytips store[10] = {
{0,0x00000001L,COLLATE,"playing one"},
{0,0x00000002L,COLLATE,"playing two"},
{0,0x00000004L,COLLATE,"playing three"},
{0,0x00000008L,COLLATE,"playing four"},
{0,0x00000008L,COLLATE,"playing five"},
{0,0x00000008L,COLLATE,"playing six"},
};
void *dinku;
dinku=(struct mytips*)malloc((sizeof(char)*sizeof(store))+1);
}
Now how can I access the values of store using void pointer? Can
somebody explaing
how to do it
Thanks in advance,
Seema