橘子味的心
标题:计算机编程使用C字符串

计算机编程使用C字符串

#include <stdio.h>



int main() {



   char ch[5] = "Hello";

   int i = 0;



   /* Print as a complete string */

   printf("String = %s\n", ch);  



   /* Print character by character */

   while( i < 5 ) {

      printf("ch[%d] = %c\n", i, ch[i] );

      i = i + 1;

   }

}

目录

分类