我想调用一个函数,函数的参数定义如下
typedef USHORT *PUSHORT;
void f(PUSHORT const pStringLen);
{
dosomething;
}我在调用时应该怎么写这个实参啊;
我现在这样调用,f(128);
结果给出错误是:D:\Code of Record\My Code\AiRecord\MyFunctions.cpp(29) : error C2664: 'MTGetCallerID' : cannot convert parameter 2 from 'const int' to 'unsigned short *const '
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
请问我应该怎么作这个类型转换后才能使之匹配
typedef USHORT *PUSHORT;
void f(PUSHORT const pStringLen);
{
dosomething;
}我在调用时应该怎么写这个实参啊;
我现在这样调用,f(128);
结果给出错误是:D:\Code of Record\My Code\AiRecord\MyFunctions.cpp(29) : error C2664: 'MTGetCallerID' : cannot convert parameter 2 from 'const int' to 'unsigned short *const '
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
请问我应该怎么作这个类型转换后才能使之匹配
解决方案 »
- VC程序release能运行,但是单独运行时会出现:应用程序正常初始化(OXCOOOO142)失败
- Debug Release
- 请问怎样像RoboForm一样在外部用程序完成IE的填表表单!
- VC中处怎样加入自定义基类
- 对话框弹出菜单
- 对不同线程之间传CWnd派生类的MFC object的一些困惑
- 改变光标的问题~~~~
- 如何去掉winhelp支持或或者直接去掉属性表上的帮助按钮
- 问题:哪位知道net send的工作机理?
- 使用template有什么限制条件亚,为什么在不同的位置写出错的个数不同呢??
- 实在是没办法了,请大侠们看看里面的代码,到底是哪里错了,错误列表也在里面,谢谢了。
- 能否有一种工具/控件可以将文件打包,用时可以自动解开运行主程序
f(&b);
PUSHORT ptr = reinterpret_cast<PUSHORT>(128);
f(ptr);