楼主: 牛尾巴
11532 126

【2015新书】Learn C the Hard Way: Practical Exercises on the Computational   [推广有奖]

泰斗

38%

还不是VIP/贵宾

-

TA的文库  其他...

最新e书

2018新书

2017新书

威望
8
论坛币
628880 个
通用积分
56892.4593
学术水平
12683 点
热心指数
12959 点
信用等级
12448 点
经验
568600 点
帖子
9173
精华
66
在线时间
13140 小时
注册时间
2008-2-13
最后登录
2024-4-25

特级学术勋章 特级热心勋章 特级信用勋章 高级学术勋章 高级热心勋章 高级信用勋章

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
图书名称:Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding
作者:
Zed A. Shaw
出版社:Addison-Wesley Professional

页数:384
出版时间:
September 2015                           
语言:
English

格式:mobi
内容简介:
You Will Learn C!
Zed Shaw has crafted the perfect course for the beginning C programmer eager to advance their skills in any language. Follow it and you will learn the many skills early and junior programmers need to succeed–just like the hundreds of thousands of programmers Zed has taught to date! You bring discipline, commitment, persistence, and experience with any programming language; the author supplies everything else.
  
In  Learn C the Hard Way , you’ll learn C by working through 52 brilliantly crafted exercises. Watch Zed Shaw’s teaching video and read the exercise. Type his code precisely. (No copying and pasting!) Fix your mistakes. Watch the programs run. As you do, you’ll learn what good, modern C programs look like; how to think more effectively about code; and how to find and fix mistakes far more efficiently. Most importantly, you’ll master rigorous defensive programming techniques, so you can use any language to create software that protects itself from malicious activity and defects.
  
Through practical projects you’ll apply what you learn to build confidence in your new skills. Shaw teaches the key skills you need to start writing excellent C software, including
  
  Setting up a C environment Basic syntax and idioms Compilation, make files, and linkers Operators, variables, and data types Program control Arrays and strings Functions, pointers, and structs Memory allocation I/O and files Libraries Data structures, including linked lists, sort, and search Stacks and queues Debugging, defensive coding, and automated testing Fixing stack overflows, illegal memory access, and more Breaking and hacking your own C code   
  It’ll  Be Hard at First. But Soon, You’ll Just Get It–And That Will Feel Great!
This tutorial will reward you for every minute you put into it. Soon, you’ll know one of the world’s most powerful programming languages. You’ll be a C programmer.
  
Watch Zed, too! The accompanying DVD contains 5+ hours of passionate, powerful teaching: a complete C video course! If you purchase the digital edition, be sure to read "Where Are the Companion Content Files" at the end of the eBook to learn how to access the videos.

回复免费:

本帖隐藏的内容

Learn C the Hard Way Practical Exercises on the Computational Subjects You Keep .rar (17.73 MB) 本附件包括:
  • Learn C the Hard Way Practical Exercises on the Computational Subjects You Keep Avoiding.mobi



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Computation Practical Exercises exercise practic practical scenario running recipes beginning

已有 8 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
kongqingbao280 + 60 奖励积极上传好的资料
xddlovejiao1314 + 100 精彩帖子
三世相思2013 + 100 + 2 + 2 + 2 精彩帖子
文化劳工 + 100 + 5 精彩帖子
2010517155lpq + 100 + 2 + 2 + 2 精彩帖子
zl89 + 60 精彩帖子
sfhsky + 80 + 5 精彩帖子
Nicolle + 100 + 100 精彩帖子

总评分: 经验 + 700  论坛币 + 100  学术水平 + 9  热心指数 + 9  信用等级 + 4   查看全部评分

本帖被以下文库推荐

沙发
rrjj101022 发表于 2015-9-14 18:30:24 |只看作者 |坛友微信交流群
  1. Exercise 3. Formatted Printing

  2. Keep that Makefile around since it’ll help you spot errors, and we’ll be adding to it when we need to automate more things.

  3. Many programming languages use the C way of formatting output, so let’s try it:

  4. ex3.c

  5. Click here to view code image

  6. 1   #include <stdio.h>
  7. 2
  8. 3   int main()
  9. 4   {
  10. 5       int age = 10;
  11. 6       int height = 72;
  12. 7
  13. 8       printf("I am %d years old.\n", age);
  14. 9       printf("I am %d inches tall.\n", height);
  15. 10
  16. 11       return 0;
  17. 12   }
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 精彩帖子

总评分: 论坛币 + 20   查看全部评分

使用道具

藤椅
maidie123456 发表于 2015-9-14 18:44:06 来自手机 |只看作者 |坛友微信交流群
  1. Variables and Types

  2. You should be getting a grasp of how a simple C program is structured, so let’s do the next simplest thing and make some variables of different types:

  3. ex7.c

  4. Click here to view code image

  5. 1   #include <stdio.h>
  6. 2
  7. 3   int main(intargc, char*argv[])
  8. 4   {
  9. 5       int distance = 100;
  10. 6       float power = 2.345f;
  11. 7       double super_power = 56789.4532;
  12. 8       char initial = 'A';
  13. 9       char first_name[] = "Zed";
  14. 10       char last_name[] = "Shaw";
  15. 11
  16. 12       printf("You are %d miles away.\n", distance);
  17. 13       printf("You have %f levels of power.\n", power);
  18. 14       printf("You have %f awesome super powers.\n", super_power);
  19. 15       printf("I have an initial %c.\n", initial);
  20. 16       printf("I have a first name %s.\n", first_name);
  21. 17       printf("I have a last name %s.\n", last_name);
  22. 18       printf("My whole name is %s %c. %s.\n",
  23. 19               first_name, initial, last_name);
  24. 20
  25. 21       int bugs = 100;
  26. 22       double bug_rate = 1.2;
  27. 23
  28. 24       printf("You have %d bugs at the imaginary rate of %f.\n",
  29. 25               bugs, bug_rate);
  30. 26
  31. 27       long universe_of_defects = 1L * 1024L * 1024L * 1024L;
  32. 28       printf("The entire universe has %ld bugs.\n", universe_of_defects);
  33. 29
  34. 30       double expected_bugs = bugs * bug_rate;
  35. 31       printf("You are expected to have %f bugs.\n", expected_bugs);
  36. 32
  37. 33       double part_of_universe = expected_bugs / universe_of_defects;
  38. 34       printf("That is only a %e portion of the universe.\n",
  39. 35               part_of_universe);
  40. 36
  41. 37       // this makes no sense, just a demo of something weird
  42. 38       char nul_byte = '\0';
  43. 39       int care_percentage = bugs * nul_byte;
  44. 40       printf("Which means you should care %d%%.\n", care_percentage);
  45. 41
  46. 42       return 0;
  47. 43   }
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 精彩帖子

总评分: 论坛币 + 20   查看全部评分

使用道具

板凳
Crsky7 发表于 2015-9-14 19:24:02 |只看作者 |坛友微信交流群
  1. Exercise 8. If, Else-If, Else

  2. In C, there really isn’t a Boolean type. Instead, any integer that’s 0 is false or otherwise it’s true. In the last exercise, the expression argc > 1 actually resulted in 1 or 0, not an explicit True or False like in Python. This is another example of C being closer to how a computer works, because to a computer, truth values are just integers.

  3. However, C does have a typical if-statement that uses this numeric idea of true and false to do branching. It’s fairly similar to what you would do in Python and Ruby, as you can see in this exercise:

  4. ex8.c

  5. Click here to view code image

  6. 1   #include <stdio.h>
  7. 2
  8. 3   int main(int argc, char *argv[])
  9. 4   {
  10. 5       int i = 0;
  11. 6
  12. 7       if (argc == 1) {
  13. 8           printf("You only have one argument. You suck.\n");
  14. 9       } else if (argc > 1 && argc < 4) {
  15. 10           printf("Here's your arguments:\n");
  16. 11
  17. 12           for (i = 0; i < argc; i++) {
  18. 13               printf("%s ", argv[i]);
  19. 14           }
  20. 15           printf("\n");
  21. 16       } else {
  22. 17           printf("You have too many arguments. You suck.\n");
  23. 18       }
  24. 19
  25. 20       return 0;
  26. 21   }
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

报纸
soccy 发表于 2015-9-14 19:37:42 |只看作者 |坛友微信交流群
  1. Exercise 9. While-Loop and Boolean Expressions

  2. The first looping construct I’ll show you is the while-loop, and it’s the simplest, useful loop you could possibly use in C. Here’s this exercise’s code for discussion:

  3. ex9.c

  4. Click here to view code image

  5. 1   #include <stdio.h>
  6. 2
  7. 3   int main(int argc, char *argv[])
  8. 4   {
  9. 5       int i = 0;
  10. 6       while (i < 25) {
  11. 7           printf("%d", i);
  12. 8           i++;
  13. 9       }
  14. 10
  15. 11       return 0;
  16. 12   }
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

地板
ekscheng 发表于 2015-9-14 22:21:19 |只看作者 |坛友微信交流群

使用道具

7
Enthuse 发表于 2015-9-14 22:21:31 |只看作者 |坛友微信交流群
thanks ..

使用道具

8
Nicolle 学生认证  发表于 2015-9-15 09:25:50 |只看作者 |坛友微信交流群
提示: 作者被禁止或删除 内容自动屏蔽

使用道具

9
auirzxp 学生认证  发表于 2015-9-15 10:05:31 |只看作者 |坛友微信交流群

ex11.c

  1. ex11.c

  2. Click here to view code image

  3. 1   #include <stdio.h>
  4. 2
  5. 3   int main(int argc, char *argv[])
  6. 4   {
  7. 5       int numbers[4] = { 0 };
  8. 6       char name[4] = { 'a' };
  9. 7
  10. 8       // first, print them out raw
  11. 9       printf("numbers: %d %d %d %d\n",
  12. 10               numbers[0], numbers[1], numbers[2], numbers[3]);
  13. 11
  14. 12       printf("name each: %c %c %c %c\n",
  15. 13               name[0], name[1], name[2], name[3]);
  16. 14
  17. 15       printf("name: %s\n", name);
  18. 16
  19. 17       // set up the numbers
  20. 18       numbers[0] = 1;
  21. 19       numbers[1] = 2;
  22. 20       numbers[2] = 3;
  23. 21       numbers[3] = 4;
  24. 22
  25. 23       // set up the name
  26. 24       name[0] = 'Z';
  27. 25       name[1] = 'e';
  28. 26       name[2] = 'd';
  29. 27       name[3] = '\0';
  30. 28
  31. 29       // then print them out initialized
  32. 30       printf("numbers: %d %d %d %d\n",
  33. 31               numbers[0], numbers[1], numbers[2], numbers[3]);
  34. 32
  35. 33       printf("name each: %c %c %c %c\n",
  36. 34               name[0], name[1], name[2], name[3]);
  37. 35
  38. 36       // print the name like a string
  39. 37       printf("name: %s\n", name);
  40. 38
  41. 39       // another way to use name
  42. 40       char *another = "Zed";
  43. 41
  44. 42       printf("another: %s\n", another);
  45. 43
  46. 44       printf("another each: %c %c %c %c\n",
  47. 45               another[0], another[1], another[2], another[3]);
  48. 46
  49. 47       return 0;
  50. 48   }
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

10
sunqing19870819 学生认证  发表于 2015-9-15 10:13:31 |只看作者 |坛友微信交流群

ex12.c

  1. ex12.c

  2. Click here to view code image

  3. 1   #include <stdio.h>
  4. 2
  5. 3   int main(int argc, char *argv[])
  6. 4   {
  7. 5       int areas[] = { 10, 12, 13, 14, 20 };
  8. 6       char name[] = "Zed";
  9. 7       char full_name[] = {
  10. 8           'Z', 'e', 'd',
  11. 9           ' ', 'A', '.', ' ',
  12. 10           'S', 'h', 'a', 'w', '\0'
  13. 11       };
  14. 12
  15. 13       // WARNING: On some systems you may have to change the
  16. 14       // %ld in this code to a %u since it will use unsigned ints
  17. 15       printf("The size of an int: %ld\n", sizeof(int));
  18. 16       printf("The size of areas (int[]): %ld\n", sizeof(areas));
  19. 17       printf("The number of ints in areas: %ld\n",
  20. 18               sizeof(areas) / sizeof(int));
  21. 19       printf("The first area is %d, the 2nd %d.\n", areas[0], areas[1]);
  22. 20
  23. 21       printf("The size of a char: %ld\n", sizeof(char));
  24. 22       printf("The size of name (char[]): %ld\n", sizeof(name));
  25. 23       printf("The number of chars: %ld\n", sizeof(name) / sizeof(char));
  26. 24
  27. 25       printf("The size of full_name (char[]): %ld\n", sizeof(full_name));
  28. 26       printf("The number of chars: %ld\n",
  29. 27               sizeof(full_name) / sizeof(char));
  30. 28
  31. 29       printf("name=\"%s\" and full_name=\"%s\"\n", name, full_name);
  32. 30
  33. 31       return 0;
  34. 32   }
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-25 17:35