代码改变世界

error C2556: 'const char &MyString::operator [](int)' : overloaded function differs only by return type from 'char &MyString::operator [](int)'

2014-02-15 20:40 by hongjiumu, 660 阅读, 0 推荐, 收藏,
摘要:char & operator[](int i);const char & operator[](int i);/*const char & operator(int i);*/编译出错:error C2556: 'const char &MyString::operator [](int)' : overloaded function differs only by return type from 'char &MyString::operator [](int)'修改:char & operator[](in 阅读全文

有个人愿意对你微笑,如果她的眼神是坚定的,她是谁对我其实已经不重要了

2014-02-15 20:39 by hongjiumu, 130 阅读, 0 推荐, 收藏,
摘要:有个人愿意对你微笑,如果她的眼神是坚定的,她是谁对我其实已经不重要了 阅读全文

error C2248: 'MyString::pCharArray' : cannot access private member declared in class 'MyString'

2014-02-15 20:38 by hongjiumu, 569 阅读, 0 推荐, 收藏,
摘要:std::ostream & operator<<(std::ostream os,const MyString & mystr){os<<mystr.pCharArray;return os;};编译出错;error C2248: 'MyString::pCharArray' : cannot access private member declared in class 'MyString'修改:std::ostream & operator<<(std::ostream & os,cons 阅读全文

c++读文件

2014-01-18 21:34 by hongjiumu, 394 阅读, 0 推荐, 收藏,
摘要:FileFormatDefine.h#ifndef _WIN32TOOLS_FILEFORMATDEFINE_H_ #define _WIN32TOOLS_FILEFORMATDEFINE_H_ const char FILE_END_CHAR = 26; #endif _WIN32TOOLS_FILEFORMATDEFINE_H_ FileReader.h#ifndef _WIN32TOOLS_FILEREADER_H_ #define _WIN32TOOLS_FILEREADER_H_ #include #include "FileFormatDefine.h" n.. 阅读全文

Run-Time Check Failure #0

2014-01-18 21:32 by hongjiumu, 2195 阅读, 0 推荐, 收藏,
摘要:Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function pointer declared with a different calling convention.This debug error means that the stack pointer register is not returned to its original value after the funct 阅读全文

CString.Format %s 字符串 要用char *

2014-01-18 21:29 by hongjiumu, 736 阅读, 0 推荐, 收藏,
摘要:CString.Format %s 字符串 错了,应该是:std::string str;CString sql;sql.Format("%s",str.c_str());所以正确的说法是%s c字符串 阅读全文

(转)DLL中导出函数的两种方式(dllexport与.def文件)

2014-01-18 21:28 by hongjiumu, 5864 阅读, 0 推荐, 收藏,
摘要:DLL中导出函数的两种方式(dllexport与.def文件)http://www.cnblogs.com/enterBeijingThreetimes/archive/2010/08/04/1792099.htmlDLL中导出函数的声明有两种方式:一种方式是:在函数声明中加上__declspec(dllexport);另外一种方式是:采用模块定义(.def)文件声明,(.def)文件为链接器提供了有关被链接程序的导出、属性及其他方面的信息。方式一:在函数声明中加上__declspec(dllexport)/// 在动态链接库程序中/// 声明动态链接库(**.dll)的对外接口函数TestF 阅读全文

new placement 的使用

2014-01-18 21:27 by hongjiumu, 318 阅读, 0 推荐, 收藏,
摘要:#include #include "TModel.h" int main() { char * p_char=new char[100]; std::coutShow(); delete pTModel; //The Second Part. TModel * pTModel2=(TModel *)(new char[sizeof(TModel)]); //If omitted, //at std::coutShow(); delete pTModel2; getchar(); ... 阅读全文

文件操作

2014-01-18 21:26 by hongjiumu, 219 阅读, 0 推荐, 收藏,
摘要:基于C的文件操作在ANSI C中,对文件的操作分两种方式:流式文件操作和I/O文件操作。一、流式文件操作这种方式的文件操作有一个重要的结构FILE,FILE在stdio.h中定义。FILE这个结构包含了文件操作的基本属性,对文件的操作都要通过这个结构的指针来进行。fopen的原型是:FILE *fopen(const char *filename,const char *mode),fopen实现三个功能:为使用而打开一个流 把一个文件和此流相连接 给此流返回一个FILR指针 参数filename指向要打开的文件名,mode表示打开状态的字符串,其取值如下表 字符串 含义 "r&qu 阅读全文

c++写文件

2014-01-18 21:25 by hongjiumu, 390 阅读, 0 推荐, 收藏,
摘要:写文件:#include #include #include int main() { FILE *fp; fp = _tfopen(_T("d:\\sss.ini"), _T("w")); //if (fp == NULL) //{ // fp=_tfopen(_T("d:\\sss.ini"), _T("w+b")); // // wchar_t m_strUnicode[1]; // m_strUnicode[0] = wchar_t(0XFEFF); // fputwc(*... 阅读全文
上一页 1 2 3 4 5 6 7 ··· 22 下一页