?? p1-48.cpp
字號(hào):
#include<iostream.h>
main()
{
//聲明字符型數(shù)組和指針變量
char str[10];
char *strip=str;
//輸入輸出
cout<<"str=";
cin>>str; //用字符數(shù)組輸入字符串
cout<<"str="<<str<<endl;
cout<<"strip="<<strip<<endl;
cout<<"strip=";
cin>>strip; //用字符指針變量輸入字符串
cout<<"str="<<str<<endl;
cout<<"strip="<<strip<<endl;
//利用指針變量改變其指向字符串的內(nèi)容
*(strip+2)='l';
cout<<"str="<<str<<endl;
cout<<"strip="<<strip<<endl;
//動(dòng)態(tài)為字符型指針變量分配內(nèi)存
strip=new char(100);
cout<<"strip=";
cin>>strip; //用字符指針變量輸入字符串
cout<<"str="<<str<<endl;
cout<<"strip="<<strip<<endl;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -