随笔分类 -  c++语言

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

c++语言
摘要:class B{ virtual int getverion() = 0;};class A:public B{private: bool val;}; //字节对齐的问题 单独bool 占一个字节 class A { private: bool val; } 阅读全文

posted @ 2021-11-25 20:41 lydstory 阅读(29) 评论(0) 推荐(0)

摘要:#ifdef _M_IX86 #define DLL_INJECT DLL_DOCONTROL #else #define DLL_INJECT DLL_DOCONTROLX64 #endif 阅读全文

posted @ 2021-05-06 11:15 lydstory 阅读(216) 评论(0) 推荐(0)

摘要:#include<windows.h>class refobj { public: refobj() : m_refcount(0) {} virtual long addref() { return InterlockedIncrement(&m_refcount); } virtual long 阅读全文

posted @ 2021-04-23 12:35 lydstory 阅读(51) 评论(0) 推荐(0)

摘要:码代码最重要的一个字“码” 码代码最重要的一个字“码” 码代码最重要的一个字“码” 阅读全文

posted @ 2021-04-23 05:09 lydstory 阅读(95) 评论(0) 推荐(0)

摘要:#include <stdio.h> #include <iostream> using namespace std; class abc { private: int a; int b; }; int main() { cout << "Hello, World!" << endl; cout < 阅读全文

posted @ 2021-04-20 23:43 lydstory 阅读(51) 评论(0) 推荐(0)

摘要:openssl aes 加密buffer数据 阅读全文

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

摘要:#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 阅读(78) 评论(0) 推荐(0)

摘要:#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 阅读(266) 评论(0) 推荐(0)

摘要: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 阅读(65) 评论(0) 推荐(0)

摘要: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 阅读(86) 评论(0) 推荐(0)

摘要:#define PROCESS_MM_HTB_SIZE (1<<5) #define PROCESS_MM_HTB_SIZE (10>>1) 阅读全文

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

摘要:#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 阅读(183) 评论(0) 推荐(0)

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

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

摘要: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 阅读(78) 评论(0) 推荐(0)

摘要:#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 阅读(356) 评论(0) 推荐(0)

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

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

摘要:#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 阅读(333) 评论(0) 推荐(0)

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

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

摘要:‘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 阅读(65) 评论(0) 推荐(0)

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

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

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

导航