CMakeLists.txt注释 时间: 2022-10-19 | 分类: c | 阅读: 51 字 ~1分钟 单行注释:使用“#” 多行注释:使用“#[[ ]]” 以下图为例 以上内容转载自互联网,若有侵权请联系站长删除
C语言获取系统时间并转换成字符串 时间: 2022-10-19 | 分类: c | 阅读: 26 字 ~1分钟 #include <time.h> #include <stdio.h> int main(int argc, char *argv[]) { time_t tt = time(0); char buf[32] = {0}; strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", localtime(&tt)); return 0; }
printf函数输出指定长度 时间: 2022-10-18 | 分类: c | 阅读: 454 字 ~1分钟 原样输出字符串: printf("%s", str); 输出指定长度的字符串, 超长时不截断, 不足时右对齐: printf("%Ns", str); –N 为指定长度的10进制数值 输出指定长度的字符串, 超长时不截断, 不足 阅读全文 »
OpenWRT 编译百科全书 时间: 2022-10-17 | 分类: OpenWrt | 阅读: 9563 字 ~20分钟 配置編譯環境 必須使用非root用戶 安裝依賴包 // Ubuntu 14.04 必選 # apt-get install asciidoc bash bc binutils bzip2 fastjar flex git-core g++ build-essential util-linux gawk libgtk2.0-dev intltool jikespg zlib1g-dev genisoimage libncurses5-dev libssl-dev patch perl-modules python2.7-dev rsync ruby sdcc unzip wget gettext xsltproc libboost1.55-dev libboost1.55-tools-dev libxml-parser-perl libusb-dev bin86 bcc bzr ecj sharutils openjdk-7-jdk zip 阅读全文 »
自定义print、log函数 以及自动加入__FILE__ __FUNCTION__ __LINE__ 等信息 时间: 2022-10-17 | 分类: c | 阅读: 77 字 ~1分钟 自定义参数的实现 void dlog(char *format, ...) { char buf[2048]; char out[2048] va_list args; va_start(args, format); vsprintf(buf, format, args); va_end(args); sprintf(out, "0x4741e2a7 %s\n", buf); /* 加上标识符和换行符 */ write(fd, out); /* 输出到指定 fd */ return; } 自动加入调用位置信息的宏定义 #define log(format, ...) dlog("%-7s 阅读全文 »
OpenWRT Packet 相关的问题 时间: 2022-10-17 | 分类: OpenWrt | 阅读: 127 字 ~1分钟 DNS 无法主动解析 若执行 opkg update 失败,则尝试执行 ping downloads.openwrt.org,若也失败,则手动在 PC上 ping downloads.openwrt.org 得到 IP 后,修改路由器的h 阅读全文 »
安装文件服务器 时间: 2022-10-17 | 分类: 运维 | 阅读: 243 字 ~1分钟 安装 apache2 服务 sudo apt-get install apache2 修改端口 默认监听的端口是80,可以自定义修改,也可不修改 修改/etc/apache2/ports.conf 修改/etc/a 阅读全文 »
Macos 中设置ternimal终端保存的命令数量和格式 时间: 2022-10-14 | 分类: 运维 macOS | 阅读: 126 字 ~1分钟 配置文件 linux 下对应的配置文件是~/.bash.rc 但是macOS下是/etc/zshrc,不同版本或许不同,具体情况具体分析 修改配置 在上述配置 阅读全文 »