
C
文章平均质量分 78
fareast_mzh
A glitch in the Matrix
展开
-
AIX下core文件 debug, segmentation fault, core dump
可显示core文件由哪个进程产生。编译时候使用-g参数。原创 2023-03-02 14:55:34 · 1466 阅读 · 0 评论 -
C语言求凸多边形面积, polygon
* polygon.c// gcc polygon.c -Wall -lm#include <stdio.h>#include <stdlib.h>#include <math.h>#ifndef null#define null ((void *)0)#endiftypedef struct { float x; float y...原创 2019-12-06 15:12:13 · 2936 阅读 · 0 评论 -
openssl 安装
1. 下载源代码wget https://www.openssl.org/source/openssl-1.1.1c.tar.gz或者下载最新版本:git clone https://github.com/openssl/openssl链接:https://pan.baidu.com/s/1Ww-zQTRo5tPEZe_zWyuQjQ提取码:k7no复制这段内容后打开百度网...原创 2019-08-26 09:55:05 · 1096 阅读 · 1 评论 -
libevent安装
1. 官方网站http://libevent.org/链接: https://pan.baidu.com/s/1zjrKSeRwDfvHn_U8Kf7dAQ 提取码: q35e 复制这段内容后打开百度网盘手机App,操作更方便哦下载代码解压chmod a+x configure./configure --prefix=/usr/local/make -j2sudo mak...原创 2019-08-24 18:28:50 · 686 阅读 · 0 评论 -
Linux操作系统错误码列表 error code list, perror实现, errno
OS error code 1: Operation not permittedOS error code 2: No such file or directoryOS error code 3: No such processOS error code 4: Interrupted system callOS error code 5: Input/outp...原创 2019-06-20 11:03:22 · 2563 阅读 · 4 评论 -
php扩展开发
1. 下载php代码cd /Volumes/Applications/lnmp/srcwget http://am1.php.net/distributions/php-7.3.2.tar.bz2tar xvjf php-7.3.2.tar.bz2 -C .cd php-7.3.2mkdir -p /Volumes/Applications/lnmp/php/7.3.2./conf...原创 2019-03-03 15:25:46 · 616 阅读 · 0 评论 -
base64 编码解码
* mybase64.c#include <stdio.h>#include <string.h>#include <stdlib.h>#define true 1#define false 0typedef unsigned char bool;static const char base64_table[] = { 'A', 'B...原创 2019-02-28 16:56:38 · 437 阅读 · 0 评论 -
C语言实现多态 (polymorphism)
使用多态,后期扩展功能,不用修改上层策略代码,只需要补充底层模块代码。依赖倒置效果。* shape.h#ifndef shape_h#define shape_htypedef short int16_t;typedef unsigned short uint16_t;typedef unsigned int uint32_t;struct ShapeVtbl;type...原创 2019-02-08 23:31:27 · 1113 阅读 · 0 评论 -
C语言实现单继承 (inheritance)
* NamedPoint.h#ifndef NamedPoint_h#define NamedPoint_hstruct NamedPoint;typedef struct NamedPoint NamedPoint;NamedPoint *makeNamedPoint(double x, double y, char *name);void setName(NamedPoin...原创 2019-02-08 16:11:46 · 726 阅读 · 1 评论 -
C语言的封装性 (encapsulation)
在实际应用中,类(class)中的公共函数和私有成员变量有封装特性。在C语言中,通过头文件中进行数据结构以及函数定义的前置声明(forward declare), 然后在程序文件中具体实现。一个简单的C程序:* point.h#ifndef point_h#define point_hstruct mypoint;typedef struct mypoint MyPoint;...原创 2019-02-08 15:19:39 · 3802 阅读 · 1 评论 -
flex 用于统计文件字符、词以及行数
* 安装bison/flexsudo apt-get install flexsudo yum install flex* words.l%option noyywrap%{int chars = 0;int words = 0;int lines = 0;%}%%[a-zA-Z]+ { words++; chars += strlen(yytext); }\n...原创 2018-12-04 19:39:22 · 2003 阅读 · 0 评论 -
vscode c/c++ include header files 配置
* 需要的插件C/C++ for Visual Studio Code C++ Intellisense E:\github\swoole\swoole-src\.vscode\c_cpp_properties.json { "configurations": [ { "name": "Win32", ...原创 2018-11-05 10:13:28 · 4398 阅读 · 0 评论 -
Linux C语言 取得MTU (最大传输单元)
参照这篇博客: http://www.geekpage.jp/programming/linux-network/book/04/4-21.php* 查看主机当前网卡,哪块在使用.ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=3<RXCSUM...原创 2018-07-20 14:54:00 · 2233 阅读 · 1 评论