楼主: Reader's
1604 14

【独家发布】C Recipes:A Problem-Solution Approach [推广有奖]

  • 0关注
  • 0粉丝

已卖:1522份资源

博士生

59%

还不是VIP/贵宾

-

TA的文库  其他...

可解釋的機器學習

Operations Research(运筹学)

国际金融(Finance)

威望
0
论坛币
41203 个
通用积分
2.6773
学术水平
7 点
热心指数
5 点
信用等级
5 点
经验
2201 点
帖子
198
精华
1
在线时间
36 小时
注册时间
2015-6-1
最后登录
2024-3-3

楼主
Reader's 发表于 2017-7-29 21:07:41 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币


























  1. Author:Shirish Chavan
  2. ISBN-10:1484229665
  3. Year:2017
  4. Pages:446
  5. Language:English
  6. File size:6.1 MB
  7. File format:PDF
  8. Category:C & C++

  9. Book Description:
  10. Solve your C programming problems with practical and informative recipes. This book covers various aspects of C programming including the fundamentals of C, operators and expressions, control statements, recursion, and user-defined functions. Each chapter contains a series of recipes that you can easily reference to quickly find the answers you are looking for.
  11. C Recipes also contains recipes and solutions for problems in memory management, arrays, standard input and output, structures and unions, pointers, self-referential structures, data files, pre-processor directives, and library functions.


  12. What You Will Learn

  13. Master operators and expressions
  14. Write user-defined functions
  15. Work with structures and unions
  16. Use pointers
  17. Define self referential structures
  18. Leverage library functions
复制代码

本帖隐藏的内容

C Recipes.pdf (6.02 MB, 需要: 5 个论坛币)


二维码

扫码加我 拉你入群

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

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

关键词:Recipes Recipe IPE CIP Fundamentals

本帖被以下文库推荐

沙发
Reader's(未真实交易用户) 发表于 2017-7-29 21:09:52

7-1. Generate Lists of Numbers in an Interactive Manner

  1. The Code
  2. The following is the code of the C program written with these specifications. Type the
  3. following C program in a text editor and save it in the folder C:\Code with the file name
  4. srs1.c:
  5. /* This program uses function calloc() for dynamic allocation of memory. */
  6. #include <stdio.h> /* L1 */
  7. /* BL */
  8. main() /* L2 */
  9. { /* L3 */
  10. int n, i, j; /* L4 */
  11. int *ptr, *list[10]; /* L5 */
  12. printf("Enter an integer as size of list (1 <= n <= 20): "); /* L6 */
  13. scanf("%d", &n); /* L7 */
  14. for(i = 0; i < 10; i++) { /* L8 */
  15. list[i] = (int *) calloc(n, sizeof(int)); /* L9 */
  16. for(j = 0; j < n; j++) /* L10 */
  17. *(list[i] + j) = i + j + 10; /* L11 */
  18. } /* L12 */
  19. /* BL */
  20. printf("Displaying the values of items in list\n"); /* L13 */
  21. for(i = 0; i < 10; i++) { /* L14 */
  22. printf("List[%d]: ", i); /* L15 */
  23. for(j = 0; j < n; j++) { /* L16 */
  24. printf("%d ", *(list[i] + j)); /* L17 */
  25. } /* L18 */
  26. printf("\n"); /* L19 */
  27. } /* L20 */
  28. /* BL */
  29. return(0); /* L21 */
  30. } /* L22 */
复制代码

藤椅
Reader's(未真实交易用户) 发表于 2017-7-29 21:14:08

7-2. Create a Linked List Using Anonymous Variables

  1. The Code
  2. The following is the code of the C program written with these specifications. Type the
  3. following C program in a text editor and save it in the folder C:\Code with the file name
  4. srs2.c:
  5. /* This program implements a simple linear linked list. */
  6. /* Function malloc() is used to create the components of list. */
  7. /* BL */
  8. #include <stdio.h> /* L1 */
  9. #include <stdlib.h> /* L2 */
  10. #include <string.h> /* L3 */
  11. /* BL */
  12. struct members { /* L4 */
  13. char name[20]; /* L5 */
  14. struct members *next; /* L6 */
  15. }; /* L7 */
  16. /* BL */
  17. typedef struct members node; /* L8 */
  18. /* BL */
  19. void display(node *start); /* L9 */
  20. /* BL */
  21. main() /* L10 */
  22. { /* L11 */
  23. node *start; /* L12 */
  24. /* BL */
  25. start = (node *) malloc(sizeof(node)); /* L13 */
  26. strcpy(start->name, "lina"); /* L14 */
  27. start->next = (node *) malloc(sizeof(node)); /* L15 */
  28. strcpy(start->next->name, "mina"); /* L16 */
  29. start->next->next = (node *) malloc(sizeof(node)); /* L17 */
  30. strcpy(start->next->next->name, "bina"); /* L18 */
  31. start->next->next->next = (node *) malloc(sizeof(node)); /* L19 */
  32. strcpy(start->next->next->next->name, "tina"); /* L20 */
  33. start->next->next->next->next = NULL; /* L21 */
  34. /* BL */
  35. printf("Names of all the members:\n"); /* L22 */
  36. display(start); /* L23 */
  37. /* BL */
  38. return(0); /* L24 */
  39. } /* L25 */
  40. /* BL */
  41. void display(node *start) /* L26 */
  42. { /* L27 */
  43. int flag = 1; /* L28 */
  44. /* BL */
  45. do { /* L29 */
  46. printf("%s\n", start->name); /* L30 */
  47. if(start->next == NULL) /* L31 */
  48. flag = 0; /* L32 */
  49. start = start->next; /* L33 */
  50. } while (flag); /* L34 */
  51. /* BL */
  52. return; /* L35 */
  53. } /* L36 */
复制代码

板凳
soccy(真实交易用户) 发表于 2017-7-29 21:45:09

报纸
bearfighting(未真实交易用户) 发表于 2017-7-29 21:50:24
很好的书啊

地板
军旗飞扬(未真实交易用户) 在职认证  发表于 2017-7-29 22:10:52
谢谢楼主分享!

7
wolfsword(真实交易用户) 发表于 2017-7-29 22:38:57
THANKS

8
sthopeli(真实交易用户) 在职认证  发表于 2017-7-29 23:13:17
thanks

9
albertwishedu(未真实交易用户) 发表于 2017-7-29 23:17:43

10
yazxf(真实交易用户) 发表于 2017-7-29 23:27:50
谢谢你的书!

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-2-4 05:09