|
|
|
|
|
|
|
[讨论]大家想想办法解决下360跟QQ的冲突问题
7点以前的QQ使用的是启动时检查360 那时候可以使用360打开QQ空间(可以绕过) 7点左右以后的话 就不行了 好像6点以前在线的(只要别下)就没有这个情况.... |
|
某公司笔试题目 求助
这题很难... |
|
[求助]new申请内存总是申请不到
我知道你那个程序的意思 但是由于你没有贴出来用new的版本 我只能按照你说思路去改 之后发现没有出现new分配失败的情况 而且很怀疑是你打开写入文件时候的情况 因为你使用的标志是把文件长度设置为0 我没有试验过,不知道这样对于没有新建的文件能创建成功不? 还有啊 为什么不在程序使用判断而要使用调试的办法去确定new的数值? 而且使用C函数的方式来做会很容易,你这个程序是基于控制台的,但是还调用API,实在很麻烦。 |
|
[求助]new申请内存总是申请不到
你的代码有释放内存么? 到最后你申请的内存都还在啊。 我帮你实验过了,新修改的代码如下: #include "stdafx.h" #include <windows.h> int _tmain(int argc, _TCHAR* argv[]) { HANDLE hCreateFile = NULL; DWORD dwFileLength = 0; HANDLE hWriteFile = NULL; DWORD dwRead = 0; int nError = 0; hCreateFile = CreateFile("M:\\1.exe",GENERIC_ALL,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);//我的磁盘比较另类,呵呵 if(NULL == hCreateFile) { printf("无法打开文件!\n"); return GetLastError(); } dwFileLength = GetFileSize(hCreateFile, NULL); if(0 == dwFileLength) { printf("获取文件大小失败!\n"); CloseHandle(hCreateFile); return GetLastError(); } //LPVOID FileBuf = VirtualAlloc(NULL,dwFileLength+1,MEM_COMMIT,PAGE_READWRITE); char *FileBuf = new char[dwFileLength+1]; //printf("0x%x\n",FileBuf); if(NULL == FileBuf) { printf("内存分配失败!\n"); CloseHandle(hCreateFile); return 1; } if(ReadFile(hCreateFile,FileBuf,dwFileLength,&dwRead,0)) { printf("读取文件成功\n\n"); printf("%d\n\n",dwRead); } else { printf("读取文件失败\n\n"); printf("%d\n\n",dwRead); nError = GetLastError(); printf("%d\n",nError); } CloseHandle(hCreateFile); hCreateFile = NULL; hWriteFile = CreateFile("M:\\bingle.exe", GENERIC_ALL, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);//我的磁盘是M盘,而且你的第5个参数不对 if(NULL == hWriteFile) { printf("创建文件失败!\n"); return GetLastError(); } if(WriteFile(hWriteFile, FileBuf, dwFileLength, &dwRead, NULL)) { printf("文件写入成功\n\n"); nError = GetLastError(); printf("%d\n\n",nError); printf("%d\n",dwRead); } else { printf("文件写入失败\n\n"); } delete []FileBuf; FileBuf = NULL; CloseHandle(hWriteFile); hWriteFile = NULL; return 0; } 以上代码在VS2003上编译通过 用new很难失败的,我怀疑是你的其他的函数失败。 不过老实说,你这个方法并不好,也只适用程序小一点的,比如说,超过10G你还能申请那么多内存? 用内存映射文件吧! |
|
[求助]菜鸟一名..想学汇编..该怎么学法?
首先找个汇编的入门的电子书来看看,网上很好找的。 比如汇编经典入门之类的,至少得看到指令能知道大概啥意思, 一般的教材上的汇编程序能写出来的程度。 这样再学其他的就容易了。 罗云彬的书就很不错,建议LZ看看。 |
|
|
|
[求助]有谁能说说旋转矩阵的源代码呢?
用matlab的话好像有函数可以用。 用C的话,大致意思 是下面的, int x=0; int y=0; int Sample[W][H];//矩阵 for(i=0;i<W;i++) { for(j=0;j<H;j++) { if(i!=W-i&&j!=H-j) { x=Sample[i][j]; y=Sample[W-i][H-j]; Sample[i][j]=y; Sample[W-i][H-j]=x; } else//转换完毕。 } } |
|
|
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值