Hello, I am new to C and I have to work with it because of need to use existing code. I went through several sites and this is my last hope. Please advise.


I have a file that defines a simple struct .. something like:


Code:
typedef struct{
  double x;
  double y;
  double z;
} Point;

Now, I have an array of type point

Point setA[anchorSize];

what I am trying to do but having issues with is as follows:


Code:
for(i=0;i<foobar;i++){
   setA[i]={pt1,pt2,pt3};//pt1-pt3 are some double values
}

However, that does not work for me. I am not sure what I am doing wrong or if this is even allowed but I get something like this for error:
remodelProtein.c:261: parse error before '{' token

This however does compile but it seems silly:


Code:
for{blabla}{
   Point tempPt={pt1,pt2,pt3};
   SetA[i]=tempPt;
}
Do I have to do it this way? Please advise

Much Much Much love and thanks for any help you can provide :smile: