c save string to struct code example
Example 1: c copy string
char *str = "Hello World!";
char copy[64]; // or 'char *copy = malloc(strlen(str) + 1);'
strcpy(copy, str);
Example 2: c file struct
typedef struct _iobuf
{
char* _ptr;
int _cnt;
char* _base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char* _tmpfname;
} FILE;