【问题标题】:expected primary-expression before ')' token')' 标记之前的预期主表达式
【发布时间】:2013-02-23 02:47:45
【问题描述】:

每当我尝试编译时,我的调试器都会出现该错误(在 ')' 标记之前的预期主表达式)。这是有错误的代码。

#define threshold 40 //threshold intensity

using namespace std;
using namespace cimg_library;

void RegionGrow (CLinkedList<struct structure> &ListName, CByteImage &Img, uint32_t uRow, uint32_t uCol)
{
 if (Img.Element (uRow+1, uCol) > threshold)
 {
  ListName.AddToTail(structure);
  Img.Element (uRow+1, uCol) = 0;
  RegionGrow (ListName, Img, uRow+1, uCol);
 }
}

有人知道C链表吗?或错误处理?请帮忙。谢谢。

【问题讨论】:

  • 这是一个代码块。编译器抱怨哪一行具体行?
  • @KrishnachandraSharma 什么?!?你不需要;
  • 1.错误究竟在哪里? 2.Img.Element是什么?
  • 你的调试器在你编译时给你一个错误?哇...只是...哇...
  • 好的。你在说什么?

标签: c++ image-processing error-handling compiler-errors linked-list


【解决方案1】:

排队:

ListName.AddToTail(结构);

结构是一种数据类型不是一个对象。

也许你打算写这样的东西:

ListName.AddToTail(ListName);

编辑:另外,您在错误的上下文中使用了术语调试器、C 链接列表和错误处理。参考一些不错的 C++ 书籍:The Definitive C++ Book Guide and List

【讨论】:

    猜你喜欢
    • 2013-08-29
    • 1970-01-01
    • 1970-01-01
    • 2017-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-13
    • 2017-09-24
    相关资源
    最近更新 更多