随笔分类 -  C/C++

c学习笔记
摘要://计算DLL路径名所需的字节数 DWORD dwSize = (lstrlenW(pszLibFile) + 1) * sizeof(wchar_t); // 获取传递进程ID的进程句柄 HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATIO 阅读全文
posted @ 2021-10-14 10:36 admrty 阅读(56) 评论(0) 推荐(0)
摘要:#include "stdio.h" #include "stdlib.h" int mystrlen(char* dest) { int length=0; while (*dest!='\0') { length++; dest++; } return length; } char *mystr 阅读全文
posted @ 2021-10-13 15:58 admrty 阅读(67) 评论(0) 推荐(0)
摘要:#include "stdio.h" #include "stdlib.h" void main() { int a[3][4]={1,2,3,4,5,6,7,8,9,10,11,12}; for (int i=0;i<3;i++) { for (int j=0;j<4;j++) { printf( 阅读全文
posted @ 2021-10-12 20:53 admrty 阅读(99) 评论(0) 推荐(0)
摘要:#include "stdio.h" #include "stdlib.h" #include "time.h" #define N 1024 void main() { int a[N]={0}; for (int i=0;i<N;i++) { a[i]=i; printf("%-6d",a[i] 阅读全文
posted @ 2021-10-07 22:01 admrty 阅读(29) 评论(0) 推荐(0)
摘要:#include "stdio.h" #include "stdlib.h" #include "time.h" #define N 100 void main() { int a[N]={0}; time_t ts; srand(unsigned int(time(&ts))); for (int 阅读全文
posted @ 2021-10-07 21:11 admrty 阅读(41) 评论(0) 推荐(0)
摘要:#include "stdio.h" #include "stdlib.h" #include "time.h" void main() { int a[10]={0}; time_t ts; srand(unsigned int(time(&ts))); for (int i=0;i<10;i++ 阅读全文
posted @ 2021-10-07 17:59 admrty 阅读(22) 评论(0) 推荐(0)
摘要:#include "stdio.h" #include "stdlib.h" //二维数组的初始化 #define N 10 void mainx() { int a[3][4]={0}; for (int i=0;i<3;i++) { for (int j=0;j<4;j++) { a[i][j] 阅读全文
posted @ 2021-10-07 13:06 admrty 阅读(273) 评论(0) 推荐(0)
摘要:#include "stdio.h" #include "stdlib.h" #define PATH "c:\\demo.txt" #define NewPATH "c:\\demonew.txt" #define N 100 void mainx() { char Arry[N]={0}; FI 阅读全文
posted @ 2021-10-01 19:15 admrty 阅读(303) 评论(0) 推荐(0)
摘要:#include "stdio.h" #include "stdlib.h" #include <malloc.h> #include "string.h" #include "windows.h" #define path "c:\\calc.exe" #define Newpath "c:\\c 阅读全文
posted @ 2021-09-30 20:50 admrty 阅读(49) 评论(0) 推荐(0)
摘要:// 数据分离和逆序输出.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "stdio.h" #include "stdlib.h" int Getwei(int n 阅读全文
posted @ 2021-09-30 00:15 admrty 阅读(40) 评论(0) 推荐(0)
摘要:#include "stdio.h"//#include "string.h" int Mystrlen(char* dest){ int length=0; while (*dest!=0) { dest++; length++; } return length;} char* Mystrcat( 阅读全文
posted @ 2021-09-24 11:05 admrty 阅读(115) 评论(0) 推荐(0)
摘要:#include <stdio.h> unsigned char Buff[20]={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A, 0x0B,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x12,0x13,0x14 }; cha 阅读全文
posted @ 2021-09-24 10:42 admrty 阅读(94) 评论(0) 推荐(0)
摘要:#include <stdio.h> struct A { int a; int b; }; struct AA { char a; short b; int c; int d[10]; A s; }; AA xx; void Function() { xx.a=1; xx.b=2; xx.c=3; 阅读全文
posted @ 2021-09-23 14:43 admrty 阅读(162) 评论(0) 推荐(0)