str.cpp

来自「经常使用的一些源程序.包括一些模板.在VC++6.0下通过.」· C++ 代码 · 共 24 行

CPP
24
字号
#include <cpp>
void info()
{
    //information here......
}
void test()
{
	char x[30] = "People's Repubic of ";
	char y[] = "China";
	cout << "\nx=" << x;
	cout << "\ny=" << y;
	cout << "\nlenth of x is: " << sizeof(x);
	cout << "\nlenth of y is: " << sizeof(y);
	cout << "\nstrcat(x, y)=" << strcat(x, y);//connect
	cout << "\nstrcpy(x, \"Chinnnnnnn\")=" << strcpy(x, "Chinnnnnn");//copy
	cout << "\tx=" << x;
	myline();
	cout << "\nstrcmp(x, y)=" << strcmp(x, y);//compare
	cout << "\nstrcmp(x, x)=" << strcmp(x, x);//compare
	cout << "\nstrcmp(y, x)=" << strcmp(y, x);//compare
	cout << "\nstrlen(x)=" << strlen(x);//string length
	cout << "\nstrlen(y)=" << strlen(y);//string length
    //code here......
}

⌨️ 快捷键说明

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