惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
U
Unit 42
aimingoo的专栏
aimingoo的专栏
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Announcements
Recent Announcements
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
M
MIT News - Artificial intelligence
博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
IT之家
IT之家
C
Check Point Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tailwind CSS Blog
D
Docker
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News

Jiajun的技术笔记

你好,2026! TiDB 源码阅读(六):TiDB Coprocessor 源码解析 性能优化的核心思想 TiDB 源码阅读(五):索引 TiDB 源码阅读(四):AST、逻辑计划、物理计划 CockroachDB Serverless Architecture podman 无故退出 Cursor Control-L (CTRL-L) Keyboard Shortcuts in Terminal Replace docker with podman Using xmonad with xfce4 A RC script for freebsd frpc 自己动手写一个k8s controller AI 会取代你的(编程)岗位吗? 自建DERP服务器提升Tailscale连接速度(使用Nginx转发) 自动升级Docker容器 再读《程序员修炼之道-从小工到专家》 让浏览器下载文件 再读《软件随想录》/《黑客与画家》/《软技能》 HTTP 压力测试中的 Coordinated Omission 2的补码 编程语言中的 context 是什么? flutter macOS 构建出错 Flatpak 使用小记 Golang CAS 操作是怎么实现的 PostgreSQL 当MQ来使用 Clash 结合 工作VPN 的网络设计 使用 PostgreSQL 搭建 JuiceFS PostgreSQL 配置优化和日志分析 有GitHub Copilot?那就可以搭建你的ChatGPT4服务 窗口函数的使用(以PG为例)
C注意事项
2014-11-04 · via Jiajun的技术笔记

2014-11-04:


-  C标准中main函数只有两种形态:

.. code:: c

    int main(void);
    int main(int argc, char *argv[]);

-  不可以通过指向字符串常量的指针修改字符串:
   很明显, 字符串常量, 不可以修改, 但是很多时候还是容易犯错误

.. code:: c

    #include <stdio.h>

    int main(void)
    {
      char *pstr = "hello, world";
      // *(pstr+2) = 'd'; 编译会报错!

      char str[] = "hello, world";
      str[3] = 'd'; // OK
      char *p_str = str;
      *(p_str + 3) = 'f'; // OK

      return (0);
    }

2014-12-01:
  • C语言中void类型怎么返回?使用\ return:

.. code:: c

void func(void)
{
  if (...) {
    return;
  }
  ...
}
  • C语言和面向对象思想并不冲突 ;) 这两者是可以在一起的

2014-12-14: ~~~~~~~~~~~

  • typedef, struct, do…while后切记要加分号;

相关文章