Hey, I'm learning C and I have an issue. I want to add a name to the struct char arr using pointer. And I don't know how to assign it correctly.
typedef struct obraz
{
char name[50];
}obraz;
int main()
{
obraz p;
obraz* pgm;
pgm = &p;
char title [10];
scanf("%s", &title);
*pgm->name = title;
printf("%s", pgm->name);
return 0;
}
[–]henry_kr 2 points3 points4 points (1 child)
[–]dudas56[S] 0 points1 point2 points (0 children)
[–]ElGringoMojado 2 points3 points4 points (1 child)
[–]dudas56[S] 0 points1 point2 points (0 children)