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,"playin g one"},
{0,0x00000002L, COLLATE,"playin g two"},
{0,0x00000004L, COLLATE,"playin g three"},
{0,0x00000008L, COLLATE,"playin g four"},
{0,0x00000008L, COLLATE,"playin g five"},
{0,0x00000008L, COLLATE,"playin g six"},
};
void *dinku;
dinku=(struct mytips*)malloc( (sizeof(char)*s izeof(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,"playin g one"},
{0,0x00000002L, COLLATE,"playin g two"},
{0,0x00000004L, COLLATE,"playin g three"},
{0,0x00000008L, COLLATE,"playin g four"},
{0,0x00000008L, COLLATE,"playin g five"},
{0,0x00000008L, COLLATE,"playin g six"},
};
void *dinku;
dinku=(struct mytips*)malloc( (sizeof(char)*s izeof(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
Comment