本人不清楚,改变优先级的小括号,就像(*p)[10]这种的,里面的小括号是什么啊?本人看它既不是运算符也不是C++标点符号,那它属于哪一部分呢?
解决方案:10分
//C++ Operators
// Operators specify an evaluation to be performed on one of the following:
//……继续阅读 »
10年前 (2015-11-12) 1410浏览
0个赞
有一UTF-8的xml文件,要读取文件内容并存入一CString对象或字符串数组中,以下是本人写的代码
CString szReturn;
CFile file;
file.Open(“C:\Trans.xml”, CFile::modeRead);
int FileSize = file.GetLength();
char *pB……继续阅读 »
10年前 (2015-11-12) 1322浏览
0个赞
本人要利用hook技术,截取打印信息,利用HOOK createDC ,获取const DEVMODE *lpInitData参数
// Hooklib.cpp : 定义 DLL 应用程序的导出函数。
在Hooklib.cpp中有创建hook函数 和本人的自定义函数,用来代替createDC 的。
正常是可以截获const DEVMODE *lpInit……继续阅读 »
10年前 (2015-11-12) 1158浏览
0个赞
C++文件操作一般针对字符流,但是怎么把本人定义的类对象存入文件和从文件中读取类对象,跪求高手帮忙,有什么好的办法。
解决方案:2分
不要试图把 整个类对象 所在的内存块写到文件中
类里提供2个方法
string ToString() const; 将本人转换成 字符流
bool FromString(); 将字符流解析后填充到各成员变量中
文件里就……继续阅读 »
10年前 (2015-11-12) 2278浏览
0个赞
本人在类内定义了一个函数
class Welcome
{
public:
Welcome(char* pixmap);
~Welcome();
private:
Texture *tex;
void mouse(int button, int state, int x, int y);//这个mouse函数
};
回调函数是一个void(*)(in……继续阅读 »
10年前 (2015-11-12) 1317浏览
0个赞
#include<iostream>
using namespace std;
class Motor
{
public:
void SwitchIgnition()
{
cout<<“Innition ON”<<endl;
}
void PumpFuel()
{
cout<<R……继续阅读 »
10年前 (2015-11-12) 1238浏览
0个赞
void reverse(struct student *ls)
{
struct student *last = ls->next;
struct student *pre = ls;
struct student *cur = ls->next;
struct student *next = NULL;
……继续阅读 »
10年前 (2015-11-12) 1239浏览
0个赞
如题,
if(a == 0xcccc) /////这样?
if(a == 0xcdcd)////或这样?
解决方案:3分
只有编译期可以(编译器抛警告)
运行时无法判断
解决方案:3分
未初始化的值是不一定的,所以上面两种方式肯定不行!
所以于其考虑怎么判断一个值有没有初始化,不好做好每个变量的初始化
解决方案:3分
初始化是什么呢?就是你第……继续阅读 »
10年前 (2015-11-12) 1716浏览
0个赞
C语言中的单链表,
例如当前指针是p
假如想指针p指向下一个结点
除了用p=p->next 外
可不可以用p++?
原因是有一道题目正确答案是p=p->next,本人想知道本人填p++正不正确
解决方案:10分
链表大多情况下并不是连续的性线存储,p++当然不行。
解决方案:2分
这样就不是C语言了。
解决方案:8分
没注意LZ……继续阅读 »
10年前 (2015-11-12) 1145浏览
0个赞