19.10.30 一点字符串

#include
#include
#include
//using namespace std;

int main()
{
     
	std::string a,b,c;
	a = "this is";
	b = " China";
	c = a + b;
	std::cout<<c<<std::endl;
	
//	char aa[] = ("asd" + "psd");  
//[Error] invalid operands of types 'const char [4]' and 'const char [4]' to binary 'operator+'
    
    char bb[] = "AbCDFhh";
    puts(strlwr(bb));      //  results: abcdfhh
    puts(strupr(bb));      //  results: ABCDFHH
 	
	char cc[100] = "!!!";   
    puts(strcat(cc, bb));  // results: !!!ABCDFHH

    strcpy(cc, bb);
    puts(cc);    // results: ABCDFHH
    
    char x[10] = "abc";
    for (int i=0; i<10; i++){
     
    	if (x[i] == '\0') std::cout<<" ! "; 
    }
    // results: !  !  !  !  !  !  ! 
    return 0;
} 

你可能感兴趣的:(19.10.30 一点字符串)