gpt4 book ai didi

c++ - 这是函数调用还是变量声明?

转载 作者:行者123 更新时间:2023-11-30 00:35:53 25 4
gpt4 key购买 nike

我无法理解以下代码的含义,请帮助我,谢谢。

在下面的代码中:

FrameDetect::Point FrameDetect::tracer(LabelData *ldata, int x, int y, int &pos, int lbl)
{
for (int i=7; i>=0; i--)
{
int tx(x);
int ty(y);
nextPoint(tx, ty, pos);
if (tx>0 && ty>0 && tx < bimg->width() && ty < bimg->height())
{
const int &l( ldata->at(tx, ty) );
if (bimg->at(tx, ty) == ccolor && (l == 0 || l == lbl))
{
return Point(tx, ty);
}
if (bimg->at(tx, ty) == bcolor)
{
ldata->at(tx, ty) = -1;
}
}
pos = (pos + 1)%8;
}
return Point(-1, -1);
}

int tx(x); 是函数调用还是变量声明?感谢您的帮助。

Source

最佳答案

相同
int tx = x;

“一个 int 构造函数”

关于c++ - 这是函数调用还是变量声明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17721291/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com