Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 使用“获取错误”;国际及&引用;_C - Fatal编程技术网

C 使用“获取错误”;国际及&引用;

C 使用“获取错误”;国际及&引用;,c,C,我得到错误VS2010 v100编译为C (708): error C2143: syntax error : missing ')' before '&' (708): error C2143: syntax error : missing '{' before '&' (708): error C2059: syntax error : '&' (708): error C2059: syntax error : ')' 如果我改为int b,我认为int&b有问题

我得到错误VS2010 v100编译为C

(708): error C2143: syntax error : missing ')' before '&'
(708): error C2143: syntax error : missing '{' before '&'
(708): error C2059: syntax error : '&'
(708): error C2059: syntax error : ')'
如果我改为int b,我认为int&b有问题-没有错误,但整个代码都不正确

void function(const int** a, int& b) /* this is 708 line */ 
{
   *code goes here...*
}

int main()
{
   ST* st = {0};
   int k;

    function(&st->value, k);
}

谢谢

< P>参考是C++的东西。要么将
b
作为指针传递,要么按值传递。

C没有按引用传递(但它应该有,这会使许多人的生活更轻松),你必须明确地这样做

代码段:

void xyzzy (int from, int &to) {
    to = from;
}
:
int a = 1, b = 2;
xyzzy (a, b);
可以用C重新编写为:

void xyzzy (int from, int *p_to) {
    *p_to = from;
}
:
int a = 1, b = 2;
xyzzy (a, &b);

您在哪里定义类型
ST
?那应该是什么呢
ST*ST={0}?初始化是st结构,但它没有做任何坏事,It&Bess C++有什么错误,我想转换成C,这个int和I不知道我将把参数改为<代码> int *b>代码>,并将函数体中的<代码> b>代码>的所有更改都改为<代码> *b>代码>。这应该涵盖大多数简单的情况,但是如果函数递归地调用自己或者做其他聪明的事情,这将不起作用。