if i have something like this.... and im getting an error msg on strcpy: " dereferencing pointer to complete type" , what is wrong?
im getting the same msg for most of my pointers and i dont know why, so i decided to try something like this simpler but i still dont see it.... can you help me:::
#include <stdio.h>
#include <malloc.h>
#include <string.h>
struct strs
{
char x;
};
typedef struct str strs;
int main()
{
strs *hola;
hola= (strs*)malloc(sizeof(strs*)*3);
char names[3][5] = {"DANA",
"RANI","SHIR"};
char *pnames[3];
int i;
for(i=0; i<3; i++)
{
pnames[i] = names[i];
strcpy(hola->x, pnames[i]);
}
system ("pause");
return (0);
}