![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Linux C
linux c编程相关技术
djgclzdyc
PostgreSQL、linux C/C++
展开
-
MinGW64 windows gcc编译器安装
界面左上方 点File。配置path 环境变量。原创 2024-03-17 14:00:20 · 420 阅读 · 0 评论 -
write写文件到磁盘、刷盘相关系统函数、标志
O_SYNC 每个write调用会自动将文件数据和元数据刷新到磁盘上,Synchronized I/O file integrity completionO_DSYNC Synchronized I/O data integrity completionO_RSYNCfsync()fdatasync() 可能会减少磁盘I/O操作的次数sync()PostgreSQL 同步磁盘文件参数sync_method.conf文件里配置:#fsync = on原创 2021-03-09 17:34:28 · 943 阅读 · 0 评论 -
C语言 指针
指针相减#include <stdio.h>int main(){int intArray[100];int a, b;printf("%d\n", (&intArray[2] - &intArray[1]));printf("%d\n", &intArray[91] - &intArray[1]);printf("%d\n", &a - &b);return 0;}[uxdb@localhost pointerSubstra原创 2020-12-18 15:19:19 · 52 阅读 · 0 评论 -
c语言static函数声明和函数定义 都在.c文件 都要加static修饰
c语言static函数声明和函数定义 都在.c文件 都要加static修饰原创 2020-08-04 16:52:40 · 2426 阅读 · 1 评论 -
warning: ‘PrintCircleQueue’ was used with no prototype before its definition [-Wmissing-prototypes]
static void PrintCircleQueue();static void PrintCircleQueue(){}Your code provides a forward declaration for function myFunct(), but that declaration is not a prototype because it does not declare the types of the (zero) function parameters (see below).原创 2020-08-04 16:31:38 · 393 阅读 · 0 评论 -
linux c编程注意事项
一个.c文件调用其它模块a.c文件实现的函数,必须包含a.h且a.h必须含义函数的原型声明。如果不包含,调用返回值为指针的函数,在64位环境,64位指针地址会被截断为低位的32bit指针值,之后再转换为64位指针,指针高位全变为FF导致指针异常,段错误,程序崩溃。...原创 2020-08-04 16:17:18 · 209 阅读 · 0 评论 -
extern声明全局数组变量
extern char xact_dir[];原创 2020-07-28 09:59:10 · 3512 阅读 · 2 评论 -
linux C一个程序里父子进程全局变量
1 #include <stdio.h>2 #include <stdlib.h>3 #include <unistd.h>4 int global = 0;56 int main(void)7 {8 pid_t pid;910 global = 10;11 printf(“the parent %d, global 0x%x %d\n”, getpid(), &global, global);12 pid =原创 2020-07-28 09:53:40 · 975 阅读 · 0 评论