楼主: Lisrelchen
2595 16

【Yung-Hsiang Lu】Intermediate C Programming [推广有奖]

  • 0关注
  • 62粉丝

VIP

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
49957 个
通用积分
79.5487
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

1论坛币

本帖隐藏的内容

Intermediate C Programming.zip (112.71 KB)


  1. Intermediate C Programming
  2. By: Yung-Hsiang Lu
  3. Publisher: CRC Press
  4. Pub. Date: June 17, 2015
  5. ISBN-13: 978-1-4987-1164-7
  6. Web ISBN-13: 978-1-4987-1164-7
  7. Print ISBN-13: 978-1-4987-1163-0
  8. Print ISBN-10: 1-4987-1163-4
  9. Web ISBN-10: 1-4987-1165-0
  10. Web ISBN-13: 978-1-4987-1165-4
  11. Web ISBN-13: 978-1-4987-1166-1
  12. Web ISBN-10: 1-4987-1166-9
  13. Pages in Print Edition: 498
  14. Subscriber Rating: 0 out of 5 rating [0 Ratings]
复制代码
https://www.crcpress.com/Intermediate-C-Programming/Lu/p/book/9781498711630



关键词:intermediate intermediat Programming Program Media rating

本帖被以下文库推荐

沙发
Lisrelchen 发表于 2017-1-31 10:39:04 |只看作者 |坛友微信交流群
  1. // arithmetic1.c
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. int main (int argc ,char * * argv)
  5. {
  6.   int    arr1[] = {7, 2, 5, 3, 1, 6, -8, 16, 4};
  7.   char   arr2[] = {'m', 'q', 'k', 'z', '%', '>'};
  8.   double arr3[] = {3.14, -2.718, 6.626, 0.529};
  9.   int len1 = sizeof(arr1) / sizeof(int);
  10.   int len2 = sizeof(arr2) / sizeof(char);
  11.   int len3 = sizeof(arr3) / sizeof(double);
  12.   printf("lengths = %d, %d, %d\n", len1, len2, len3);
  13.   int    * iptr = arr1;
  14.   char   * cptr = arr2;
  15.   double * dptr = arr3;
  16.   printf("values = %d, %c, %f\n", * iptr, * cptr, * dptr);
  17.   iptr ++;
  18.   cptr ++;
  19.   dptr ++;
  20.   printf("values = %d, %c, %f\n", * iptr, * cptr, * dptr);
  21.   iptr ++;
  22.   cptr ++;
  23.   dptr ++;
  24.   printf("values = %d, %c, %f\n", * iptr, * cptr, * dptr);
  25.   iptr ++;
  26.   cptr ++;
  27.   dptr ++;
  28.   printf("values = %d, %c, %f\n", * iptr, * cptr, * dptr);
  29.   return EXIT_SUCCESS;
  30. }
复制代码

使用道具

藤椅
Lisrelchen 发表于 2017-1-31 10:39:57 |只看作者 |坛友微信交流群
  1. // swap1.c
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. void swap1 (int a , int b)
  5. {
  6.   int k = a;
  7.   a = b;
  8.   b = k;
  9. }
  10. int main (int argc ,char * * argv)
  11. {
  12.   int u;
  13.   int t;
  14.   u = 17;
  15.   t = -96;
  16.   printf ("before swap1: u = %d , t = %d \n" , u , t);
  17.   swap1 (u , t);
  18.   printf ("after  swap1: u = %d , t = %d \n" , u , t);
  19.   return EXIT_SUCCESS;
  20. }
复制代码

使用道具

板凳
Lisrelchen 发表于 2017-1-31 10:40:50 |只看作者 |坛友微信交流群
  1. // aredistinct.c
  2. int areDistinct(int * arr, int len)
  3. {
  4.   int ind1;
  5.   int ind2;
  6.   for (ind1 = 0; ind1 < len; ind1 ++)
  7.     {
  8.       for (ind2 = ind1 + 1; ind2 < len; ind2 ++)
  9.         {
  10.           if (arr[ind1] == arr[ind2])
  11.             {
  12.               // found two elements with the same value
  13.               return 0;
  14.             }
  15.         }      
  16.     }
  17.   // have not found two elements of the same value
  18.   return 1;
  19. }
复制代码

使用道具

报纸
Lisrelchen 发表于 2017-1-31 10:42:03 |只看作者 |坛友微信交流群
  1. /*
  2. * charint.c
  3. * how C treats integer and character differently
  4. */
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. int main(int argc, char * * argv)
  8. {
  9.   int v = 55;
  10.   printf("%d\n", v);
  11.   printf("%c\n", v);
  12.   return EXIT_SUCCESS;
  13. }
复制代码

使用道具

地板
Lisrelchen 发表于 2017-1-31 10:42:33 |只看作者 |坛友微信交流群
  1. /*
  2. * countsubstr.c
  3. * count the occurrence of a substring
  4. * argv[1] is the longer string
  5. * argv[2] is the shorter string
  6. * argv[1] may contain space if the string enclosed by " "
  7. */

  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. int main(int argc, char * argv[])
  12. {
  13.   int count = 0;
  14.   char * ptr;
  15.   if (argc < 3)
  16.     {
  17.       printf("Please enter two strings.\n");
  18.       return EXIT_FAILURE;
  19.     }
  20.   printf("argv[1] = %s, strlen = %d\n", argv[1],
  21.          (int) strlen(argv[1]));
  22.   printf("argv[2] = %s, strlen = %d\n", argv[2],
  23.          (int) strlen(argv[2]));
  24.   ptr = argv[1];
  25.   do
  26.     {
  27.       ptr = strstr(ptr, argv[2]);
  28.       if (ptr != NULL)
  29.         {
  30.           printf("%s\n", ptr);
  31.           count ++;
  32.           ptr ++;
  33.         }
  34.     } while (ptr != NULL);
  35.   if (count == 0)
  36.     {
  37.       printf("argv[2] is not a substring of argv[1].\n");   
  38.     }
  39.   else
  40.     {
  41.       printf("argv[2] occurs %d times in argv[1].\n", count);   
  42.     }
  43.   return EXIT_SUCCESS;
  44. }
复制代码

使用道具

7
ekscheng 发表于 2017-1-31 10:53:23 |只看作者 |坛友微信交流群

使用道具

8
wenyu 发表于 2017-1-31 11:09:18 |只看作者 |坛友微信交流群
kkkkkkkkkkkkkk

使用道具

9
yazxf 发表于 2017-1-31 11:23:55 |只看作者 |坛友微信交流群
谢谢你的书!

使用道具

10
nivastuli 发表于 2017-1-31 12:37:04 |只看作者 |坛友微信交流群
。。。。。。。。。。。。。。。。。。

使用道具

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

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

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

GMT+8, 2024-4-28 03:05