|
C语言文件操作疑问[求助]
#include<stdio.h> #include<stdlib.h> int main() { FILE *f; if((f = fopen("Super.txt","r+")) == NULL) { printf("big error\n"); getchar(); exit(1); } char ch; if(fseek(f,1,1) == EOF) /* 改成if(fseek(f,0,SEEK_CUR) == EOF) 将指针偏移改为0开始 */ { printf("seek error\n"); } for(int i=0;i<3;i++) { printf("%c\n",fgetc(f)); /* 这里不能同时使用fgetc和fputc,因为fgetc和fputc每操作一次都会将文件指针++ */ fputc('k',f); printf("%c\n",fgetc(f)); } fclose(f); system("pause"); return 0; } /* 所以,将你上面的源码改成如下 */ #include<stdio.h> #include<stdlib.h> int main() { FILE *f; if((f = fopen("Super.txt","r+")) == NULL) { printf("big error\n"); getchar(); exit(1); } char ch; if(fseek(f,0,SEEK_CUR) == EOF) { printf("seek error\n"); } for(int i=0;i<=3;i++) { fputc('k',f); /* 连续写入4个'k' */ } if(fseek(f,0,SEEK_SET) == EOF) /* 重新设定文件指针 */ { printf("seek error\n"); } for(i=0; i<=3;i++) /* 将写入的内容一个一个打印出来 */ { printf("%c\n",fgetc(f)); } fclose(f); system("pause"); return 0; } |
|
HappyTown申请『CrackMe & ReverseMe』版主
呵呵,和这里的兄弟姐妹们比起来,我还差的很远呢,和你一样,我也是自学的。 |
|
HappyTown申请『CrackMe & ReverseMe』版主
我也支持Happytown |
|
|
|
|
|
[求助]编写<<软件加密技术内幕>>PE分析器时遇到的编译错误
ImageRvaToVa是在Imagehlp.h文件中定义的,你可以试试引入这个文件 |
|
[求助]编写<<软件加密技术内幕>>PE分析器时遇到的编译错误
PE error LNK2019: 无法解析的外部符号 __imp__ImageRvaToVa@16 ,该符号在函数 "void * __cdecl RvaToPtr(struct _IMAGE_NT_HEADERS *,void *,unsigned long)" (?RvaToPtr@@YAPAXPAU_IMAGE_NT_HEADERS@@PAXK@Z) 中被引用 ImageRvaToVa函数未定义及实现。我看了一下你的源码,找不到ImageRvaToVa的定义及实现代码。 |
|
[求助]动态创建图形按钮
如果只是将其控制权交回给他的回调函数,可以试试这样(不过我也没有试过动态生成按钮,以下代码仅供参考:P:): CallWindowProc(GetWindowLong(hWndClose,GWL_USERDATA),hWnd,uMsg,wParam,lParam); 不过你还要在这里加上这一句。 void CreateButtons(HWND hWnd) { #ifdef _USECLOSEBTN hWndClose = CreateWindow("STATIC", 0, WS_CHILD | WS_VISIBLE | SS_BITMAP | SS_NOTIFY, rctCloseBtn.left, rctCloseBtn.top, 13, 13, hWnd, NULL, hInst, 0); ShowWindow(hWndClose, SW_SHOWNORMAL); SendMessage(hWndClose, STM_SETIMAGE, IMAGE_BITMAP, hBTN_CLOSE_NORM); SetWindowLong(hWndClose,GWL_USERDATA,SetWindowLong(hWndClose, GWL_WNDPROC, ButtonProc)); #endif } |
|
Delphi下构建无导入表程序-使用:hash获取API,k32Base等[转帖]
贴子重复,所以锁贴。 |
|
初学WIN32,写了一个俄罗斯方块程序练练手
不错,开源支持。 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值