c++程序调试问题,请sos

aoxue 2004-04-14 09:19:17
我如下简单的代码,调试不过,请help me,3qu
#include<iostream>

using namespace std;

int work(int *pi);

int work(int *pi) {
*pi = 1024;
return *pi;
}

int main(int argc, char* argv[])
{
int ival1;
int *pi1 = &ival1;

ival1 = work(*pi1);

return 0;
}
错误提示:
-------------------Configuration: aoxuePoint1 - Win32 Debug--------------------
Compiling...
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\include\xlocale(467) : error C2857: '#include' statement specified with the /Ycstdafx.h command-line option was not found in the source file
Error executing cl.exe.

aoxuePoint1.exe - 1 error(s), 0 warning(s)


...全文
108 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
aoxue 2004-07-25
  • 打赏
  • 举报
回复
呵呵
谢谢大家了
“ival1 = work(*pi1);”
是这句错了,参数传递错了
bm1408 2004-07-23
  • 打赏
  • 举报
回复

#include<iostream>

using namespace std;



int work(int *pi) {
*pi = 1024;
return *pi;
}

int main(int argc, char* argv[])
{
int ival1;
int *pi1 = &ival1;

ival1 = work(pi1);
cout<<ival1<<endl;

return 0;
}
漂行者 2004-07-23
  • 打赏
  • 举报
回复
將ivall = work(*pil)改成
ival1 = work(pi1);
bm1408 2004-07-23
  • 打赏
  • 举报
回复
以后写这样的程序,用VC里面控制台程序做!

选择一个简单的CONSOLE,直接有了stdafx.h
bohut 2004-07-23
  • 打赏
  • 举报
回复
#include<iostream>

using namespace std;

int work(int *pi);

int work(int *pi) {
*pi = 1024;
return *pi;
}

int main(int argc, char* argv[])
{
int ival1;
int *pi1 = &ival1;

ival1 = work(pi1);

return 0;
}
myblind 2004-07-23
  • 打赏
  • 举报
回复
include 一下 Stdafx.h
或在 Project Settings 设置 C/C++ 的 Precompiled Headers 为 Not using.
aoxue 2004-07-23
  • 打赏
  • 举报
回复
怎么没人回复我啊
不是太难吧:)

2,586

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 资源
社区管理员
  • 资源
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧