⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pointer2.c

📁 c版本的
💻 C
字号:
                                         /* Chapter 8 - Program 2 */
main()
{
char strg[40],*there,one,two;
int *pt,list[100],index;

   strcpy(strg,"This is a character string.");

   one = strg[0];                    /* one and two are identical */
   two = *strg;
   printf("The first output is %c %c\n",one,two);

   one = strg[8];                   /* one and two are indentical */
   two = *(strg+8);
   printf("the second output is %c %c\n",one,two);

   there = strg+10;           /* strg+10 is identical to strg[10] */
   printf("The third output is %c\n",strg[10]);
   printf("The fourth output is %c\n",*there);

   for (index = 0;index < 100;index++)
      list[index] = index + 100;
   pt = list + 27;
   printf("The fifth output is %d\n",list[27]);
   printf("The sixth output is %d\n",*pt);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -