Advertisement

C_类型名、相关功能或操作

阅读量:

一、字符串相关研究

举例: 字符串的多种表达形式

复制代码
 #include<stdio.h>

    
  
    
 #define NAME "I am LAND_CRUISERSYH"         //字符串常量
    
 #define LONGTH 50
    
  
    
 int main()
    
  
    
 {
    
     char words[LONGTH] = "Hello world!";    //char类型数组
    
     const char *p = "I am coming";          //指向char的指针
    
     puts("Hello");        
    
     puts(NAME);
    
     puts(words);
    
     puts(pt1);
    
     words[11] = '.';
    
     puts(words);
    
     return 0;
    
 }
    
    
    
    

puts()函数 同样隶属于stdio.h系列 中的输入与输出函数,其功能仅用于展示字符串,并会在所显示字符串的末尾自动添加换行符

1.在程序中定义

全部评论 (0)

还没有任何评论哟~