資源簡介
用c++做的例子,利用指針數(shù)組冒泡法排序

代碼片段和文件信息
//?pointArr.cpp?:?定義控制臺應(yīng)用程序的入口點。
//
#include?“stdlib.h“
#include?“stdafx.h“
#include?“iostream“
#include?“string“
using?namespace?std;
int?_tmain(int?argc?_TCHAR*?argv[])
{
string?text;
const?string?separators=“.\“\n“;
const?int?max_words=5;
string?words[5]={“hset““uwt““btet““cwte““atet“};
string*?pwords[max_words];
int?word_count=0;
while(word_count pwords[word_count]=&words[word_count];
word_count++;
}
for(int?j=0;j for(int?i=0;i if((*pwords[i]).substr(01)>(*pwords[i+1]).substr(01))
{
string*?ptemp=pwords[i];
pwords[i]=pwords[i+1];
pwords[i+1]=ptemp;
}
}
}
for(int?i=0;i cout< system(“pause“);
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????6020??2011-12-09?11:01??pointArr\Debug\BuildLog.htm
?????文件?????????67??2011-12-09?11:01??pointArr\Debug\mt.dep
?????文件??????45056??2011-12-09?11:01??pointArr\Debug\pointArr.exe
?????文件????????403??2011-12-09?10:09??pointArr\Debug\pointArr.exe.em
?????文件????????468??2011-12-09?10:09??pointArr\Debug\pointArr.exe.em
?????文件????????385??2011-12-09?11:01??pointArr\Debug\pointArr.exe.intermediate.manifest
?????文件?????341168??2011-12-09?11:01??pointArr\Debug\pointArr.ilk
?????文件??????33672??2011-12-09?11:01??pointArr\Debug\pointArr.obj
?????文件????1048576??2011-12-09?10:09??pointArr\Debug\pointArr.pch
?????文件?????551936??2011-12-09?11:01??pointArr\Debug\pointArr.pdb
?????文件??????10553??2011-12-09?10:09??pointArr\Debug\stdafx.obj
?????文件?????175104??2011-12-09?11:01??pointArr\Debug\vc80.idb
?????文件?????241664??2011-12-09?11:01??pointArr\Debug\vc80.pdb
?????文件????????818??2011-12-09?11:01??pointArr\pointArr.cpp
?????文件????1002496??2011-12-09?14:27??pointArr\pointArr.ncb
?????文件????????880??2011-12-09?10:03??pointArr\pointArr.sln
????..A..H.??????7680??2011-12-09?14:27??pointArr\pointArr.suo
?????文件???????4490??2011-12-09?10:03??pointArr\pointArr.vcproj
?????文件???????1427??2011-12-09?14:27??pointArr\pointArr.vcproj.WWW-E26AC25E5A8.Administrator.user
?????文件????????956??2011-12-09?10:03??pointArr\ReadMe.txt
?????文件????????213??2011-12-09?10:03??pointArr\stdafx.cpp
?????文件????????276??2011-12-09?10:03??pointArr\stdafx.h
?????目錄??????????0??2011-12-09?11:01??pointArr\Debug
?????目錄??????????0??2011-12-09?11:01??pointArr
-----------?---------??----------?-----??----
??????????????3474308????????????????????24
評論
共有 條評論