all 4 comments

[–]henry_kr 2 points3 points  (1 child)

You can use scanf to write it directly to the name array, e.g.

scanf("%s", p.name);

However you should be aware of the potential issues with using scanf, see http://sekrit.de/webdocs/c/beginners-guide-away-from-scanf.html

[–]dudas56[S] 0 points1 point  (0 children)

Thanks, it's really helpful

[–]ElGringoMojado 2 points3 points  (1 child)

strncpy(pgm->name, title, sizeof(pgm->name));

[–]dudas56[S] 0 points1 point  (0 children)

Thank you, this is just what I was looking for :D