summaryrefslogtreecommitdiffhomepage
path: root/zh-cn/c-cn.html.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'zh-cn/c-cn.html.markdown')
-rw-r--r--zh-cn/c-cn.html.markdown10
1 files changed, 5 insertions, 5 deletions
diff --git a/zh-cn/c-cn.html.markdown b/zh-cn/c-cn.html.markdown
index 8566e811..851f2981 100644
--- a/zh-cn/c-cn.html.markdown
+++ b/zh-cn/c-cn.html.markdown
@@ -1,5 +1,5 @@
---
-language: c
+language: C
filename: learnc-cn.c
contributors:
- ["Adam Bard", "http://adambard.com/"]
@@ -128,7 +128,7 @@ printf("Enter the array size: "); // 询问用户数组长度
char buf[0x100];
fgets(buf, sizeof buf, stdin);
-// stroul 将字符串解析为无符号整数
+// strtoul 将字符串解析为无符号整数
size_t size = strtoul(buf, NULL, 10);
int var_length_array[size]; // 声明VLA
printf("sizeof array = %zu\n", sizeof var_length_array);
@@ -474,7 +474,7 @@ void testFunc() {
// 用户自定义类型和结构
///////////////////////////////////////
-// Typedefs可以创建类型别名
+// typedef 可以创建类型别名
typedef int my_type;
my_type my_type_var = 0;
@@ -612,11 +612,11 @@ typedef void (*my_fnp_type)(char *);
最好找一本 [K&R, aka "The C Programming Language", “C程序设计语言”](https://en.wikipedia.org/wiki/The_C_Programming_Language)。它是关于C最重要的一本书,由C的创作者撰写。不过需要留意的是它比较古老了,因此有些不准确的地方。
-另一个比较好的资源是 [Learn C the hard way](http://c.learncodethehardway.org/book/)
+另一个比较好的资源是 [Learn C the hard way](http://learncodethehardway.org/c/)
如果你有问题,请阅读[compl.lang.c Frequently Asked Questions](http://c-faq.com/)。
-使用合适的空格、缩进,保持一致的代码风格非常重要。可读性强的代码比聪明的代码、高速的代码更重要。可以参考下[Linux内核编码风格](https://www.kernel.org/doc/Documentation/CodingStyle)
+使用合适的空格、缩进,保持一致的代码风格非常重要。可读性强的代码比聪明的代码、高速的代码更重要。可以参考下[Linux内核编码风格](https://www.kernel.org/doc/Documentation/process/coding-style.rst)
除了这些,多多Google吧