C 语言编程
从 printf 到指针、内存和数据结构 —— 在您的浏览器中编写并在我们的服务器上编译和运行。
- c
- 23 课程
- 23 videos
- 在浏览器中运行
此设备:完成 0 / 23 门课程
每节课均在浏览器中运行——编写真实代码,点击运行,任务自动检查。免费,无需账户,配有与英文对照的翻译笔记。
本课程中的课程
显示 27 / 27 门课程
没有找到匹配的课程。请清除搜索条件或选择其他筛选器。
- C 基础:main、printf 与函数 C 是一门编译型语言 · C 的基本骨架 · printf 与类型 Lesson 1 · 3 项必做任务 · ★ 视频
- Variables, types, and arithmetic Every value has a type · Doing arithmetic · Integers divide differently · Reading input Lesson 2 · 3 项必做任务 · ★ 视频
- Booleans and selection: if, else, switch True and false in C · Comparing and combining · if / else if / else · switch: choosing among many values Lesson 3 · 3 项必做任务 · ★★ 视频
- Loops: while, for, and accumulation Repeating work · while loops · for loops · Accumulation and counting Lesson 4 · 3 项必做任务 · ★★ 视频
- Functions, parameters, and return values Why functions · Parameters and return values · void functions, and building big from small · C copies your arguments Lesson 5 · 3 项必做任务 · ★★ 视频
- Nested loops and patterns A loop inside a loop · Rows and columns · Building a line, then a block · Counting with nested loops Lesson 6 · 3 项必做任务 · ★★★ 视频
- 1-D arrays: store, index, and traverse A row of boxes · Indexing from 0 · Traversing with a loop · Arrays don't know their own length Lesson 7 · 3 项必做任务 · ★★ 视频
- Pointers: &, *, and pass-by-pointer A problem from last lesson · Every variable has an address · A pointer holds an address · Out-pointers: giving back more than one answer Lesson 8 · 3 项必做任务 · ★★★ 视频
- Strings: char arrays and the null terminator Text is an array of chars · The invisible terminator '\0' · Walking a string · The <string.h> toolbox Lesson 9 · 3 项必做任务 · ★★★ 视频
- Array algorithms: max, count, search, average Four classic array jobs · Finding the maximum · Counting with a condition · Linear search Lesson 10 · 4 项必做任务 · ★★★ 视频
- 2-D arrays: working with a grid A grid of boxes · Rows then columns (row-major) · Passing a 2-D array · Working one row at a time Lesson 11 · 3 项必做任务 · ★★★ 视频
- Searching: linear and binary Two ways to search · Linear search · Why sorting enables binary search · low, high, mid Lesson 12 · 3 项必做任务 · ★★★ 视频
- Sorting: bubble, selection, and insertion Putting an array in order · Swapping two elements · Bubble sort · Insertion sort Lesson 13 · 3 项必做任务 · ★★★★ 视频
- Recursion: base case and recursive case A function that calls itself · The base case · The recursive case · Recursion over an array Lesson 14 · 3 项必做任务 · ★★★★ 视频
- Structs and typedef: . vs -> Grouping related data · struct and typedef · Member access with . · Through a pointer with -> Lesson 15 · 3 项必做任务 · ★★★ 视频
- Dynamic memory: malloc, free, and realloc Stack memory vs heap memory · malloc and sizeof · free and memory leaks · Growing an array with realloc Lesson 16 · 3 项必做任务 · ★★★★ 视频
- 链表 Nodes joined by pointers · A self-referential struct · head and the NULL end · Adding a node at the front Lesson 17 · 3 项必做任务 · ★★★★★ 视频
- Stacks and queues (array-backed) Two ways to hold items · A stack is LIFO · Array-backed stack · A queue is FIFO Lesson 18 · 3 项必做任务 · ★★★★ 视频
- Text files: write then read Files keep data after the program ends · Opening and closing · Writing with fprintf · Reading with fscanf and fgets Lesson 19 · 3 项必做任务 · ★★★ 视频
- 用返回码处理错误 C has no try/except · Return a status code · Reporting the answer through an out-pointer · Sentinels for "no value" Lesson 20 · 3 项必做任务 · ★★★ 视频
- Bits, binary, and bitwise operators Numbers are bits · Place value and powers of two · Reading a bit with >> and & 1 · The bitwise operators Lesson 21 · 3 项必做任务 · ★★★ 视频
- Run-length encoding (compression) Squeezing repeated data · What a "run" is · Counting a run · Building the encoded string Lesson 22 · 3 项必做任务 · ★★★★ 视频
- Preprocessor, const, static, and enum What runs before the compiler · #include and #define · const vs #define · static and enum Lesson 23 · 3 项必做任务 · ★★★ 视频
阅读与资源
- C 语言简史 Where C came from · Close to the machine · The famous book · C today 阅读与资源
- C 语言用来做什么 What people build with C · Operating systems · Tiny computers everywhere · Databases and other languages 阅读与资源
- 更多学习资源 边玩边练 · 阅读与参考 · 本站更多内容 · 小提示 阅读与资源
- 设置你的电脑 Run C on your own computer · Step 1 — Install a compiler · Step 2 — Install VS Code · Step 3 — Add the C/C++ extension 阅读与资源
Open the C reference
Every topic in one place, with short examples you can run.
深入学习入口
- Learn-C.org 免费、动手实践的 C 语言课程,在浏览器里运行
- Exercism —— C 专项 小练习,还有友善的导师反馈
- HackerRank —— C 从易到难的练习题
- cppreference —— C 严谨、免费的参考手册,涵盖每一个 C 函数
- 《C 程序设计语言》(K&R) C 语言创造者所写的经典著作
- Visual Studio Code 在自己电脑上写 C 语言的免费编辑器
- C 练习题(本站) 更多 C 语言挑战,检验自己
- AP CS A(本站) 学习 Java,C 语言的另一位近亲