C语言
edaplayer
这个作者很懒,什么都没留下…
展开
-
拓扑排序,求深度朴素解法
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <securec.h> #include <ctype.h> #include <stdbool.h> #include <errno.h> #include "uthash.h" #include <stdint.h> #define MAXVEX 5000 int ...原创 2021-08-20 09:29:50 · 194 阅读 · 0 评论 -
结构体 位域 字节对齐
https://blog.csdn.net/tanqiuwei/article/details/7176334 https://blog.csdn.net/zuo_an/article/details/100554113 https://blog.csdn.net/chuocongzhou7584/article/details/101052952 #pragma pack(8) typedef struct MyStruct { unsigned char ucpa1 : 2;原创 2021-08-19 16:37:41 · 177 阅读 · 0 评论 -
C语言strtol
函数原型: long int strtol (const char* str, char** endptr, int base); 注意第二个形参是二级指针,如果定义char *stop,那么要出入&stop #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> int main(void) { const char *str = "1原创 2021-08-06 09:46:23 · 228 阅读 · 0 评论 -
C语言strtok和strok_s
#include <stdio.h> #include <stdlib.h> #include <securec.h> int main(int argc, char *argv[]) { char str[] = "1,2,3,4,5"; const char *sep = ","; char *pStr = NULL; pStr = strtok(str, sep); while (pStr != NULL) {...原创 2021-08-06 09:43:04 · 767 阅读 · 0 评论 -
uthash vim 模板
``` snippet ihash "Init hash table" typedef struct { int key; int val; UT_hash_handle hh; } ${1:HashTable}; endsnippet snippet shash "Init hash table" typedef struct { char key[STR_LEN]; int value; UT_hash_handle hh; } ${1:HashTab...原创 2021-08-05 09:16:53 · 179 阅读 · 0 评论