为什么VS2010提示我。没有命中短点啊??
#include "stdafx.h"
#include "packet.h"
#include <iostream>
#include <Windows.h>
using namespace std;
#include <Windows.h>
using namespace std;
void PutInt(char *pPacket,int value,int &nPos)
{
*(int*)(pPacket + nPos) = value; //断点这行总是不到断点,, 控制台 aaaa也打印出来了!!! 什么原因nPos += sizeof(int);
cout<<"aaaaa"<<endl;
}
int GetInt(char *pPacket,int &nPos)
{
int value = *(int*)(pPacket + nPos);
nPos += sizeof(int);
return value;
}
int _tmain(int argc, _TCHAR* argv[])
{
int paketPos;
char packet[1024];
char temp[1024];
paketPos = 2;
PutInt(packet,520,paketPos);
cout<<"OK!!!"<<endl;
//获取
int value = GetInt(packet,paketPos);
cout<<value<<endl;
system("pause");
return 0;
}
[解决办法]
给数组赋值要这么不直观吗?
代码是给人看的,直观点好,优化与否等大神回复。
[解决办法]
断点断不到吗?
[解决办法]
关闭优化
重建所有
[解决办法]