被调用对象不是函数c [英] called object not a function c

查看:110
本文介绍了被调用对象不是函数c的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好,-这些东西已经煮了我的面条了(而且,用谷歌搜索我注意到的c编程语言非常困难...)

Good morning SO- this ones been cooking my noodle for a bit (also, it's very hard to google about the c programming language I've noticed...)

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);
  }
}

我收到此错误:

error: called object ‘copyFrame’ is not a function

原型与定义匹配.有什么作用?

The prototypes match the definition. What gives?

推荐答案

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

You've redefined copyFrame in that local scope:

PFrame copyFrame = prep->first;

这篇关于被调用对象不是函数c的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆