#include
#include
struct data
{
char s[30];
int n;
float x;
};
struct data example()//定義結構體類型函數
{
struct data emp;
strcpy_s(emp.s, "An example!");
emp.n = 68;
emp.x = 213.52;
printf("%s%d%f\n", emp.s, emp.n, emp.x);
printf("Function to run after:\n");
return(emp);
}
void main()
{
struct data redata;
printf("\nOperation function:\n");
redata = example();
printf("%s%d%f\n", redata.s, redata.n, redata.x);
}
http://blog.csdn.net/johnny710vip/article/details/6681160