摘要:
#include "stdafx.h"#include #include #include using namespace std;int main(void){ vector ve1; ve1.push_back("123"); vector::iterator it1; char* elem="123"; it1 = find(ve1.begin(), ve1.end(), elem); cout<<*it1;} 阅读全文
随笔档案-2012年12月8日
C语言 获取系统临时目录并获取临时文件名
2012-12-08 20:32 by 每天努力一点点, 664 阅读, 收藏,
摘要:
char tempFileName[MAX_PATH]; char sysTempPath[MAX_PATH+1]; GetTempPath (MAX_PATH,sysTempPath); GetTempFileName(sysTempPath,"rar",0,tempFileName); 阅读全文
C语言 写文件样例
2012-12-08 20:31 by 每天努力一点点, 182 阅读, 收藏,
摘要:
HANDLE hf = CreateFile("d:/a.txt",GENERIC_WRITE | GENERIC_READ,FILE_SHARE_WRITE,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); DWORD dwCount; char* str ="test\r\n"; int len =strlen(str); WriteFile(hf, str, len, &dwCount, NULL);CloseHandle(hf); 阅读全文
C语言List使用样例
2012-12-08 20:30 by 每天努力一点点, 1450 阅读, 收藏,
摘要:
#include #include #include #include using namespace std;//创建一个list容器的实例LISTCHARtypedef list LISTCHAR;int main(int argc, char* argv[]){ //用LISTCHAR创建一个名为listOne的list对象 LISTCHAR listTwo; //声明i为迭代器 LISTCHAR::iterator j; //从前面向listTwo容器中添加数据 listTwo.push_front ("A123"); listTwo.push_front (&qu 阅读全文
浙公网安备 33010602011771号