Hi I was working on my project file and I have to do work with structs. So I created a sample program that is small to see how to implement in my program.
Below is the program:
Code:
#include <stdio.h>
typedef struct{
double x;
double y;
}data;
data function(void);
int main(void)
{
double a, b;
data table;
table = function();
printf("%lf %lf", table.x, table.y);
return 0;
}
data function(void)
{
data fTable;
fTable.x = 4;
fTable.y = 5;
return fTable;
}
Can I make a struct = another struct if they are of the same type?
the output is 3 doubles (3.90000000 3.444000 3.09000), even if I take the printf out of the program lol!
Help please!