随笔分类 -  c++语言

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

c++语言
void *p sizeof 8
摘要:int main() { void *p; cout<<sizeof(p)<<endl; return 0; } 8 指针 返回指针 阅读全文

posted @ 2021-12-30 06:15 lydstory 阅读(20) 评论(0) 推荐(0) 编辑

类的构造函数 类型一样 变量名不一样无所谓
摘要:// 你必须定义一个 `main()` 函数入口。 #include <iostream> using namespace std; #include <string.h> typedef const char* FX_LPCSTR; typedef char FX_CHAR; typedef in 阅读全文

posted @ 2021-12-30 06:06 lydstory 阅读(24) 评论(0) 推荐(0) 编辑

std::numeric_limits<int>::min()
摘要:#include <limits> #include <iostream> // /* reference: http://www.cplusplus.com/reference/limits/numeric_limits/ https://msdn.microsoft.com/en-us/libr 阅读全文

posted @ 2021-12-30 04:54 lydstory 阅读(474) 评论(0) 推荐(0) 编辑

模板实现判断一个int是否是一个有效的int
摘要:enum RangeConstraint { RANGE_VALID = 0x0, // Value can be represented by the destination type. RANGE_UNDERFLOW = 0x1, // Value would overflow. RANGE_O 阅读全文

posted @ 2021-12-30 04:01 lydstory 阅读(26) 评论(0) 推荐(0) 编辑

CFX_StringData
摘要:// 你必须定义一个 `main()` 函数入口。 #include <iostream> using namespace std; typedef const char* FX_LPCSTR; typedef char FX_CHAR; typedef int FX_STRSIZE; class 阅读全文

posted @ 2021-12-30 03:13 lydstory 阅读(34) 评论(0) 推荐(0) 编辑

字符对齐(long int)
摘要:struct bb{ int a; char bb;}; 8class aa{ private: long dd; char b;}; 16 阅读全文

posted @ 2021-12-30 03:12 lydstory 阅读(26) 评论(0) 推荐(0) 编辑

sizeof 24
摘要:struct CFX_StringData { long m_nRefs; int m_nDataLength; int m_nAllocLength; char m_String[1]; }; sizeof 24 struct CFX_StringData { long m_nRefs; int 阅读全文

posted @ 2021-12-30 03:08 lydstory 阅读(14) 评论(0) 推荐(0) 编辑

malloc 函数
摘要:void *malloc(size_t size); void free(void *ptr); void *calloc(size_t nmemb, size_t size); void *realloc(void *ptr, size_t size); 函数 返回值 参数 阅读全文

posted @ 2021-12-30 02:42 lydstory 阅读(21) 评论(0) 推荐(0) 编辑

operator new delete操作符重载
摘要:#include <iostream> using namespace std; typedef const char* FX_LPCSTR; class CFX_Object { public: void* operator new(size_t size, FX_LPCSTR file, int 阅读全文

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

某面试题考什么不懂
摘要:#include <iostream> using namespace std; int main() { // int VAL; int sum = 0; int cnt = 0; int i; for( i =0; i<6 ;i++) { cnt+=sum; sum+= 2 * (i %2) - 阅读全文

posted @ 2021-12-06 20:38 lydstory 阅读(15) 评论(0) 推荐(0) 编辑

华为机考(牛客网)字符统计
摘要:#include <stdio.h> #include <string.h> #define MAXLEN 500 int acsciinum(const char* str) { int len = strlen(str); if(len > MAXLEN) return -1; int ret[ 阅读全文

posted @ 2021-12-02 15:57 lydstory 阅读(70) 评论(0) 推荐(0) 编辑

判断一个IP是否有效(牛客网通过正确)
摘要:#include <iostream> #include <stdio.h> using namespace std; bool ValidIpAddr(char const * str) { int n, ip1, ip2, ip3, ip4; char dummy; bool valid = t 阅读全文

posted @ 2021-12-01 11:49 lydstory 阅读(98) 评论(0) 推荐(0) 编辑

牛客网c++如何处理输入输出
摘要:牛客网c++如何处理输入输出 牛客网c++如何处理输入输出 牛客网c++如何处理输入输出 阅读全文

posted @ 2021-12-01 11:27 lydstory 阅读(84) 评论(0) 推荐(0) 编辑

streambuf
摘要:streambuf是标准c++的一个类,每个输入输出流对象包含一个指向streambuf的指针.并且streambuf有一些可供调用的函数.例如:为了访问streambuf,每个输入输出流对象包含一个成员函数rdbuf(),它返回的是一个指向对象streambuf的指针.通过这个指针可以对strea 阅读全文

posted @ 2021-11-27 05:53 lydstory 阅读(152) 评论(0) 推荐(0) 编辑

sizeof 8
摘要: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 阅读(18) 评论(0) 推荐(0) 编辑

_M_IX86 32位处理器宏定义
摘要:#ifdef _M_IX86 #define DLL_INJECT DLL_DOCONTROL #else #define DLL_INJECT DLL_DOCONTROLX64 #endif 阅读全文

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

class refobj
摘要:#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 阅读(46) 评论(0) 推荐(0) 编辑

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

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

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

上一页 1 ··· 17 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

统计

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