# include & ltstring.h & gt
# include & ltiostream.h & gt
void main()
{
char str[4][10]={"ccc "," aaa "," bbb "," DDD " };//定義四個字符串
char * p[4];
for(int y = 0;y & lt4;y++)
{
p[y]= str[y];
}
for(int I = 0;我& lt3;i++)
{
for(int j = I+1;j & lt4;j++)
{
充電溫度[10];
if(* p[I]& gt;*p[j])//比較str[i]和str[j]的ASCII值。
{
temp[10]= * p[I];//將str[i]賦給temp[10]
* p[I]= * p[j];
* p[j]= temp[10];
}
}
}
for(int k = 0;k & lt4;k++)
cout & lt& ltstr[k]& lt;& ltendl
}