การเขียนโปรแกรม C
ตั้งแต่ printf ไปจนถึงพอยเตอร์ เมมโมรี่ และโครงสร้างข้อมูล — เขียนในเบราว์เซอร์ของคุณและคอมไพล์พร้อมรันบนเซิร์ฟเวอร์ของเรา
- c
- 23 บทเรียน
- 23 videos
- ทำงานบนเบราว์เซอร์ของคุณ
บนอุปกรณ์นี้: สำเร็จ 0 จาก 23 บทเรียน
ทุกบทเรียนทำงานบนเบราว์เซอร์ของคุณ — เขียนโค้ดจริง กด Run และงานจะตรวจสอบตัวเองอัตโนมัติ ฟรี ไม่ต้องสมัครบัญชี พร้อมบันทึกคำแปลคู่กับภาษาอังกฤษ
บทเรียนในหลักสูตรนี้
แสดง 27 จาก 27 บทเรียน
ไม่พบบทเรียนที่ตรงกับการค้นหา ล้างการค้นหาคืนหรือเลือกตัวกรองอื่น
- พื้นฐาน C: main, printf, และฟังก์ชัน C เป็นภาษาที่ compiled · โครงสร้างหลักของ C · printf และ types 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 รายการ · ★★★★ วิดีโอ
- ลิงค์ลิสต์ (Linked lists) 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 รายการ · ★★★ วิดีโอ
- Error handling with return codes 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 ทุกตัว
- The C Programming Language (K&R) หนังสือคลาสสิกโดยผู้สร้างภาษา C
- Visual Studio Code โปรแกรมแก้ไขฟรีสำหรับการเขียน C บนคอมพิวเตอร์ของคุณเอง
- ปัญหาฝึก C (เว็บไซต์นี้) ท้าทายเพิ่มเติมด้าน C เพื่อทดสอบตัวเอง
- AP CS A (เว็บไซต์นี้) เรียนรู้ Java, cousins ใกล้เคียงอีกตัวหนึ่งของ C