I don't know how to add multiple values for a struct in C using a pointer. Here's my code and the gcc error is:
error: assignment to expression with array type
(p+0)->name = "Teszt";
#include <stdio.h>
typedef struct{
char name[101];
int born_in;
} paciens;
int main(){
paciens *p;
int n = 5;
p = (paciens*) malloc(n * sizeof(paciens));
(p+0)->name = "Test";
(p+0)->born_in = 1992;
printf("Name: %s ; Born in: %d\n", (p+0)->name, (p+0)->born_in);
return 0;
}
(p+0)->name = "Test";==>strcpy((p+0)->name, "Test");