S
spleen
Hiya,
Im a newbie to C so please excuse my ignorance...
Ok, so I have several C files, with my functions in, one has main in
of course! and I have 2 structs as outside of the funtions (therefore
global?) in one of the files.
I can pass my information into the structs with no major difficulties,
that was easy! anyway now im trying to read from the structure into a
fuction so i can use the variables. this is where my difficulties
start and I believe its due to either my prototype or a pointer?
although im really not sure hence the question...
so this is my struture which is stored in file1.c
typedef struct{
int TRI_1;
int TRI_2;
int TRI_3;
}Triangles;
and then in main.c I have a function like this
void render(Triangles Tri)
{
int a;
a = Tri[n].TRI_1;
}
which has a prototype at the top like this
void render(Triangles tria, Vectors Vecs)
I have cut down on what I have actually wrote so its easier to read,
but thats the basis of it. I dont understand structures enough to do
figure this out. Ive read various sources including but still dont get
it, can someone enlighten me?
also just out of curiousity, is this operater - -> called the infix?
Thanks in advance, I am most grateful
dave
Im a newbie to C so please excuse my ignorance...
Ok, so I have several C files, with my functions in, one has main in
of course! and I have 2 structs as outside of the funtions (therefore
global?) in one of the files.
I can pass my information into the structs with no major difficulties,
that was easy! anyway now im trying to read from the structure into a
fuction so i can use the variables. this is where my difficulties
start and I believe its due to either my prototype or a pointer?
although im really not sure hence the question...
so this is my struture which is stored in file1.c
typedef struct{
int TRI_1;
int TRI_2;
int TRI_3;
}Triangles;
and then in main.c I have a function like this
void render(Triangles Tri)
{
int a;
a = Tri[n].TRI_1;
}
which has a prototype at the top like this
void render(Triangles tria, Vectors Vecs)
I have cut down on what I have actually wrote so its easier to read,
but thats the basis of it. I dont understand structures enough to do
figure this out. Ive read various sources including but still dont get
it, can someone enlighten me?
also just out of curiousity, is this operater - -> called the infix?
Thanks in advance, I am most grateful
dave