⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sortstringarray.cpp

📁 最适合在学校成批地建立删除学生用户或学生文件夹
💻 CPP
字号:
// SortStringArray.cpp: implementation of the CSortStringArray class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "UMIB.h"
#include "SortStringArray.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CSortStringArray::CSortStringArray()
{

}

CSortStringArray::~CSortStringArray()
{

}

void CSortStringArray::Sort()
{
	BOOL bNotDone = TRUE;   
	int nPrevious = 0;
	int nNext=0;
	CString strTemp;
	while (bNotDone)   
	{
		bNotDone = FALSE;
		for(;nPrevious < GetUpperBound();++nPrevious)
		{
			nNext=nPrevious+1;
		    if (GetAt(nPrevious).CompareNoCase(GetAt(nNext)) > 0)   
			{
			   strTemp = GetAt(nPrevious);      
			   SetAt(nPrevious, GetAt(nNext));
			   SetAt(nNext, strTemp);
			   bNotDone=TRUE;
			}
		}
	}
}

⌨️ 快捷键说明

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