被称为对象而不是函数c

Set*_*hot 0 c pointers copy-constructor

早上好 - 这些都是我的面条烹饪了一点(同样,谷歌关于我注意到的c编程语言很难...)

void prepareFrames(PDouble prep){
  int gap = prep->gap;
  printf("Gap is %d\n", gap);
  prep->intFrames = (PFrame*)malloc(gap*sizeof(PFrame));
  PFrame copyFrame = prep->first;
  int i;
  for(i=0; i < gap; i++){
    prep->intFrames[i] = (PFrame)malloc(sizeof(Frame));
    copyFrame(prep->intFrames[i], prep->first, i);          //LINE 189
  }
}

void copyFrame(PFrame new, PFrame copy, int num){
  new->sequence = copy->sequence;
  new->evaluatedFrame = copy->evaluatedFrame + num;
  new->numBoxes = copy->numBoxes;
  new->boxes = (PBox*)malloc(copy->numBoxes*sizeof(PBox));
  int i;
  for(i=0; i < copy->numBoxes; i++){
    PBox old = copy->boxes[i];
    new->boxes[i] = (PBox)malloc(sizeof(Box));
    copyBox(new->boxes[i], old);
  }
}
Run Code Online (Sandbox Code Playgroud)

我收到这个错误:

error: called object ‘copyFrame’ is not a function
Run Code Online (Sandbox Code Playgroud)

原型符合定义.是什么赋予了?

use*_*116 6

您已copyFrame在该本地范围内重新定义:

PFrame copyFrame = prep->first;
Run Code Online (Sandbox Code Playgroud)