
Patrick B. answered 06/11/19
Math and computer tutor/teacher
hmmmm.... how about a little memcpy ?????
//============================================
#include <string.h>
typedef struct foo_t
{
int a, b, c;
} foo_t;
const foo_t foo_init = { 1, 2, 3 };
#define FOO_SIZE (sizeof(struct foo_t))
int main()
{
foo_t my_foo;
memcpy(&my_foo,&foo_init,FOO_SIZE);
printf(" %d %d %d \n",my_foo.a, my_foo.b, my_foo.c);
return 0;
}