随笔分类 -  c++语言

上一页 1 ··· 21 22 23 24 25

c++语言
文件二进制读到结构体
摘要:FILE* fp=fopen(sFileName,"rb"); fseek(fp,0,SEEK_END); int len = ftell(fp); fseek(fp,0,SEEK_SET); char* s = (char*)malloc(len); fread(s,1,len,fp); fclo 阅读全文

posted @ 2020-11-13 14:32 lydstory 阅读(216) 评论(0) 推荐(0) 编辑

头文件之后using namespace std;
摘要:头文件之后using namespace std; 头文件之后using namespace std; 头文件之后using namespace std; 注意 必须先include 然后namespace 阅读全文

posted @ 2020-10-20 19:45 lydstory 阅读(127) 评论(0) 推荐(0) 编辑

0-15转二进制
摘要:二维字符数组。char s[16][5]={"0000","0001",...};cout<<s[k]<<endl; 阅读全文

posted @ 2020-08-24 13:50 lydstory 阅读(520) 评论(0) 推荐(0) 编辑

写入buffer 文件 换行
摘要: 阅读全文

posted @ 2020-07-17 11:03 lydstory 阅读(233) 评论(0) 推荐(0) 编辑

gethostname 环境 -》错
摘要:#include "stdafx.h" #include<winsock2.h> #include <stdio.h> #pragma comment(lib, "ws2_32.lib") char m_sznode[32+1] = {0}; int GetComputerName(char *lp 阅读全文

posted @ 2020-05-21 20:38 lydstory 阅读(203) 评论(0) 推荐(0) 编辑

windows dll
摘要:#pragma once #include <windows.h> #ifdef FONTREPLACE_EXPORTS #define FONTREPLACE_API __declspec(dllexport) #else #define FONTREPLACE_API __declspec(dl 阅读全文

posted @ 2020-02-19 04:00 lydstory 阅读(159) 评论(0) 推荐(0) 编辑

Google开放HTML5解析库Gumbo的源代码
摘要:Google开放HTML5解析库Gumbo的源代码 Google开放HTML5解析库Gumbo的源代码 阅读全文

posted @ 2020-02-18 14:00 lydstory 阅读(231) 评论(0) 推荐(0) 编辑

apache::thrift::server
摘要:apache::thrift::server 阅读全文

posted @ 2020-02-18 13:57 lydstory 阅读(149) 评论(0) 推荐(0) 编辑

__attribute__((visibility("default")))
摘要:https://www.jianshu.com/p/1e6315145fcf 阅读全文

posted @ 2020-02-18 13:52 lydstory 阅读(525) 评论(0) 推荐(0) 编辑

c++编码规范:变量加空格,if空行
摘要:变量加空格,if空行 变量加空格,if空行 变量加空格,if空行 阅读全文

posted @ 2020-02-17 11:16 lydstory 阅读(747) 评论(0) 推荐(0) 编辑

fstat获得文件大小方法_pdfium
摘要:#include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/stat.h> #include <unistd.h> //获取文件的大小 int get_file_size(int f) { struct stat st; fstat(f, &st); return st.st_size; } int main(vo 阅读全文

posted @ 2020-01-17 14:02 lydstory 阅读(320) 评论(0) 推荐(0) 编辑

FX_DWORD >>4 等于0
摘要:#include <iostream> typedef unsigned int FX_DWORD; typedef unsigned long long FX_UINT64; typedef unsigned int FX_UINTPTR; int main() { FX_DWORD i = ((FX_DWORD)(FX_UINTPTR)1) >> 4; std::cout << i << st 阅读全文

posted @ 2020-01-17 11:24 lydstory 阅读(135) 评论(0) 推荐(0) 编辑

c语言中>>4是什么意思;有什么含义
摘要:这是位运算符中的右移运算符:a>>4表示将a的个二进制位右移4位,移到右端的低位被舍弃,对无符号数,高位补0例如:a=017时:a的值用二进制形式表示为:00001111,a>>4为:00000000|1111【后面的1111舍弃】右移一位相当于除以2,右移n位,就相当于除以2^n。 阅读全文

posted @ 2020-01-17 10:59 lydstory 阅读(2236) 评论(0) 推荐(0) 编辑

void* &rvalue
摘要:FX_BOOL Lookup(void* key, void*& rValue) const; char *avoid *pvoid *&rValue=prValue表示是void*类型的引用。这里&表示引用p=(void*)(&a) 。表示取a的地址,并将改地址强制转换为(void *)类型,这里 阅读全文

posted @ 2020-01-17 10:50 lydstory 阅读(153) 评论(0) 推荐(0) 编辑

#define 定义一个变量 什么都不做 类似注释
摘要:#define FX_FINAL #define FX_OVERRIDE 阅读全文

posted @ 2020-01-17 02:37 lydstory 阅读(398) 评论(0) 推荐(0) 编辑

buf 数据写入文件
摘要:参考c++: fstream file("/root/bbb.pdf", ofstream::app | ios::binary | ofstream::out); if (!file){ cerr << "open sec.txt failure" << endl; } for ( int i = 阅读全文

posted @ 2020-01-14 10:17 lydstory 阅读(572) 评论(0) 推荐(0) 编辑

bitcoin
摘要:https://github.com/wangyi160/bitcoin 阅读全文

posted @ 2020-01-09 10:54 lydstory 阅读(101) 评论(0) 推荐(0) 编辑

linux w_char 转 char
摘要:wchar_t returnString1[5120]; setlocale(LC_ALL, "UTF-8"); int nLen=wcstombs(NULL, returnString1, 0); char* m_char=new char[nLen + 1]; memset(m_char, 0, nLen + 1); int nRet=wcstombs(m_char, retstruc.ret 阅读全文

posted @ 2020-01-03 09:52 lydstory 阅读(392) 评论(0) 推荐(0) 编辑

iconv转换
摘要://///////////////////////////////////////////////////// #include <iconv.h> #include <stdlib.h> #include <stdio.h> int code_convert(char *from_charset,char *to_charset,char *inbuf,size_t inlen,char *ou 阅读全文

posted @ 2019-12-21 18:54 lydstory 阅读(395) 评论(0) 推荐(0) 编辑

fd (int)读写文件
摘要:原文链接:https://blog.csdn.net/hhhlizhao/article/details/71552588 阅读全文

posted @ 2019-12-09 23:47 lydstory 阅读(450) 评论(0) 推荐(0) 编辑

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

统计

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