ç是否允许地址参数? [英] Does C allow parameter by address?

查看:113
本文介绍了ç是否允许地址参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到一个编译错误以下语句:

I am getting a compilation error for the following statement:

void read_text(int & c1, int & c2, string file1, string file2 )

我似乎得到传递地址时,误差;该错误消息如下:

I seem to get error when passing the address; the error message is below:

Error   13  error C2143: syntax error : missing ')' before '&'  \\vmware-host\shared folders\school\misc\johncpp\porj\similarity.c  101

我使用的Visual Studio。

I am using on Visual Studio.

推荐答案

C那样被允许传递指针,这是参数引用平时机制。然而,并不像在C ++中,你所使用的语法。相反,它是:

C does allow passing a pointer, which is the usual mechanism for parameter references. However, the syntax is not as used in C++, which you have used. Instead it is:

void read_text(int * c1, int * c2, string file1, string file2)

这篇关于ç是否允许地址参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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