![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C
wxsy024680
这个作者很懒,什么都没留下…
展开
-
C——esc按键按下与识别
esc按键ASCII码为27,模拟按下esc按键代码如下:# include <stdio.h># include <windows.h> int main(){ keybd_event(27, 0, 0, 0); //按下 Sleep(100); keybd_event(27, 0, 2, 0); //松开 return 0;}识别esc按键按下代码如下:# include <stdio.h># include <windows.原创 2021-05-30 04:45:06 · 7601 阅读 · 0 评论 -
C——文本文件
1、读取文本文件#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAX_LINE 1024int main(){ FILE *fp; int i, len, rows=0; char buf[MAX_LINE]; int pos[MAX_LINE][2]; //读取文本文件 if((fp = fopen("test.txt","r")) == NULL) {原创 2021-05-11 15:05:07 · 4786 阅读 · 0 评论 -
C——识别键盘按下&模拟键盘按下
# include <stdio.h># include <windows.h> int main(){ int E,S,C; while(1) { //GetKeyState只能识别大写字母对应的ASCII码值 E = GetKeyState(69);//获取E键状态 S = GetAsyncKeyState(83);//获取S键状态 C = GetAsyncKeyState(67);//获取C键状态 if(E<0 &原创 2021-05-11 15:02:28 · 5213 阅读 · 0 评论 -
C——数组
#include <stdio.h>#include <stdbool.h>int main(){ char *gains1[] = {"29","57"}; //字符串数组 int gains2[] = {29,57}; //整数数组 bool flag = true; printf("%d\n", atoi(gains1[0])); //字符串转整数 printf("%d\n", gains2[0]); if (flag && 1 &a原创 2021-05-08 20:52:59 · 4750 阅读 · 0 评论