随笔分类 -  c++语言

上一页 1 ··· 18 19 20 21 22 23 24 25 下一页

c++语言
openssl aes 加密buffer数据
摘要:openssl aes 加密buffer数据 阅读全文

posted @ 2021-03-10 19:08 lydstory 阅读(68) 评论(0) 推荐(0) 编辑

strncat
摘要:#include<stdio.h> #include<string.h> int main(void) { int n; char dest[20] = "Hello"; char src[10] = "World"; strncat(dest, src, 5);//n=5为src前n个字符 pri 阅读全文

posted @ 2021-03-09 22:45 lydstory 阅读(71) 评论(0) 推荐(0) 编辑

strncpy
摘要:#include<stdio.h> #include<string.h> int main(){ char name[]={"Chinanet"},destin[20]={}; strncpy(destin,name,3); printf("%s\n",destin); } Chi strncpy基 阅读全文

posted @ 2021-03-09 22:03 lydstory 阅读(258) 评论(0) 推荐(0) 编辑

typedef 基本类型
摘要:typedef unsigned int UINT32; typedef unsigned int DWORD; typedef unsigned short WORD ; typedef unsigned char BYTE; typedef unsigned char UCHAR; typede 阅读全文

posted @ 2021-03-09 21:53 lydstory 阅读(52) 评论(0) 推荐(0) 编辑

fcntl flock文件记录锁
摘要:fcntl flock #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <fcntl.h> int FileUnLock(int fd_lock) { struct flo 阅读全文

posted @ 2021-03-09 21:23 lydstory 阅读(70) 评论(0) 推荐(0) 编辑

位移的思想
摘要:#define PROCESS_MM_HTB_SIZE (1<<5) #define PROCESS_MM_HTB_SIZE (10>>1) 阅读全文

posted @ 2021-03-02 15:28 lydstory 阅读(36) 评论(0) 推荐(0) 编辑

window linux 头文件
摘要:#ifndef _PLATFORMDEF_H_ #define _PLATFORMDEF_H_ #ifdef _LINUX #include <sys/time.h> #include <unistd.h> /* SHOULD be before any other include files */ 阅读全文

posted @ 2021-03-01 19:20 lydstory 阅读(179) 评论(0) 推荐(0) 编辑

sizeof枚举
摘要:enum dscommand{ DS_MIN, DS_MAX } std::cout<<sizeof(DS_MAX)<<std::endl; 4个字节 阅读全文

posted @ 2021-02-23 15:26 lydstory 阅读(64) 评论(0) 推荐(0) 编辑

_str_t 部分函数(内部)
摘要:1.小写输出 _str_t Val("AFSDFSasdfsdf"); cout<< Val.toLowerCase().data()<<endl; 2.中文输出 _str_t Val("中国人"); cout<< Val.data()<<endl; 3. _str_t agentId("_Want 阅读全文

posted @ 2021-02-13 09:07 lydstory 阅读(72) 评论(0) 推荐(0) 编辑

linux c++获取年月日
摘要:#include <stdio.h> #include <string.h> #include <string> #include <iostream> using namespace std; #define CHAR char int GetDate(const string &fmt, str 阅读全文

posted @ 2021-02-13 08:15 lydstory 阅读(351) 评论(0) 推荐(0) 编辑

qobject_cast
摘要:T qobject_cast ( QObject * object ) 本方法返回object向下的转型T,如果转型不成功则返回0,如果传入的object本身就是0则返回0。 在使用时有两个限制: 1# T类型必须继承自QObject。 2# 在声明时必须有Q_OBJECT宏。 阅读全文

posted @ 2021-02-04 21:56 lydstory 阅读(145) 评论(0) 推荐(0) 编辑

for循环的goto必须放在for内部
摘要:#include <stdio.h> #include <iostream> using namespace std; int main() { int q = 0; for(q =0; q < 3; q++) { if(q==0) { cout<<"11111"<<endl; goto label 阅读全文

posted @ 2021-01-27 20:33 lydstory 阅读(322) 评论(0) 推荐(0) 编辑

error: expected ';', ',' or ')' before '&' token 解决方法
摘要:1、常规的解决方法:用指针来取代引用,在主函数中传进来地址; 2、将代码扩展名保存成.cpp文件 为什么? 我们可以认为,c不认引用传递,但是c++支持引用传递啊! 【转】:https://blog.csdn.net/donoot/article/details/80155918 https://b 阅读全文

posted @ 2021-01-26 20:01 lydstory 阅读(2141) 评论(0) 推荐(0) 编辑

atoi stdlib.h close unistd.h
摘要:‘close’ was not declared in this scope ‘read’ was not declared in this scope ‘sysconf’ was not declared in this scope 没有包含头文件 unistd.h 造成的。 加上' #inclu 阅读全文

posted @ 2021-01-25 20:25 lydstory 阅读(58) 评论(0) 推荐(0) 编辑

libnet
摘要:建锋:(C)libnet-发送arp/tcp/icmp数据包建锋:可用开源libnet,简单点。 阅读全文

posted @ 2021-01-25 20:01 lydstory 阅读(74) 评论(0) 推荐(0) 编辑

ubuntu 安装wireshark
摘要:sudo apt-get install wireshark 必须提前安装qt开发环境 阅读全文

posted @ 2021-01-19 20:26 lydstory 阅读(108) 评论(0) 推荐(0) 编辑

libpcap获取网卡名称
摘要:#include <pcap/pcap.h> #include <stdio.h> int main() { char errbuf[PCAP_ERRBUF_SIZE], *device; device = pcap_lookupdev(errbuf); if(device) { printf("S 阅读全文

posted @ 2021-01-19 15:09 lydstory 阅读(159) 评论(0) 推荐(0) 编辑

libpcap 过滤 pcap_compile
摘要:libpcap 过滤 pcap_compile ubuntu安装libpcap https://www.cnblogs.com/flyinggod/p/9322267.html 阅读全文

posted @ 2021-01-19 14:19 lydstory 阅读(151) 评论(0) 推荐(0) 编辑

c安全:发行当前执行用户目录
摘要:#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { char arr[10]; strcpy(arr,getenv("HOME")); printf("%s",arr); return 0; } 阅读全文

posted @ 2021-01-16 16:21 lydstory 阅读(39) 评论(0) 推荐(0) 编辑

上一页 1 ··· 18 19 20 21 22 23 24 25 下一页

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示