亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? dynamicarrays.cpp

?? 《基于symbian os的手機(jī)開(kāi)發(fā)與應(yīng)用》
?? CPP
字號(hào):
// DynamicArrays.cpp

//Author:LiuLiPing
//version 1.0
//Date: 2006-2-18

// Examples to demonstrate arrays

#include "CommonFramework.h"
#include <e32math.h>

void FruitRArray();
void FruitFixFlat();

//
// Common literal text
//

_LIT(KMsgPressAnyKey," (press any key to continue)\n");
_LIT(KMsgInsert,"\n\n--->InsertL\n");
_LIT(KMsgModify,"\n\n--->Modify\n");
_LIT(KMsgDelete,"\n\n--->Delete\n");
_LIT(KMsgFind,"\n\n--->Find\n");
_LIT(KMsgSortID,"\n\n--->SortID\n");
_LIT(KMsgSortName,"\n\n--->SortName\n");
_LIT(KMsgNewLine,"\n");

//
// Common format strings
//

_LIT(KName,"Name is:");
_LIT(KID,"ID is: %d\n");
_LIT(KPrice,"Price is: %f\n");

//
// A T type class used in the example demonstrating the:
// RArray class and CArrayFixFlat class
// 
class TFruit
	{
public :
	TFruit(TInt aID, const TDesC& aName, TReal aPrice);
	~TFruit();
public :
	TInt iID;		//水果的ID
	HBufC* iName;	//水果名
	TReal iPrice;	//水果的單價(jià)
	};

TFruit::TFruit(TInt aID, const TDesC& aName, TReal aPrice)
{
	iID = aID;
	iName = aName.Alloc();
	iPrice = aPrice;
}
TFruit::~TFruit()
{
	delete iName;
	iName = NULL;
	iID = 0;
	iPrice = 0;
}

//
//比較ID ,用于按水果的ID排序(從1——n)
//

TInt CompareFruitID(const TFruit& aFruit1, const TFruit& aFruit2)
{
	if(aFruit1.iID>aFruit2.iID)
		return 1;
	if(aFruit1.iID==aFruit2.iID)
		return 0;
	else 
		return -1;
}

//
//比較名字,用于按水果的名字排序(從A——Z)
//

TInt CompareFruitName(const TFruit& aFruit1, const TFruit& aFruit2)
{
	TPtr ptr1 =aFruit1.iName->Des();
    TPtr ptr2 =aFruit2.iName->Des();
	return ptr1.Compare(ptr2);
}

//
//比較兩個(gè)水果名是否相同(用于查找)
//

TBool FindFruitName(const TFruit& aFruit1, const TFruit& aFruit2)
{
	if(*aFruit1.iName==(*aFruit2.iName))
		return ETrue;
	else 
		return EFalse;
}

void FruitRArray()
{
	RArray<TFruit> rarray;      //用RArray類(lèi)存儲(chǔ)數(shù)據(jù)
    CleanupClosePushL(rarray);	//壓入清理?xiàng)?
	_LIT(KFruit1,"watermelon");
	TBuf<12> buf1(KFruit1);
	_LIT(KFruit2,"peach");
	TBuf<10> buf2(KFruit2);
	_LIT(KFruit3,"orange");
	TBuf<10> buf3(KFruit3);

	TFruit fruit1(1,buf1,1.5);
	TFruit fruit2(2,buf2,2.8);
	TFruit fruit3(3,buf3,1.2);

	rarray.Append(fruit1);		//添加數(shù)據(jù)到數(shù)組中
	rarray.Append(fruit2);
    for(TInt i=0;i<rarray.Count();i++)	//顯示數(shù)組中所有的數(shù)據(jù)
	{
	  console->Printf(KID,rarray[i].iID);
	  console->Printf(KName);
	  TPtr ptr = rarray[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,rarray[i].iPrice);
	  console->Printf(KMsgNewLine);
	}

	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgInsert);
	rarray.Insert(fruit3,0);		//向數(shù)組插入數(shù)據(jù),插入的數(shù)據(jù)是數(shù)組的第一個(gè)元素
    for(i=0;i<rarray.Count();i++)
	{
	  console->Printf(KID,rarray[i].iID);
	  console->Printf(KName);
	  TPtr ptr = rarray[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,rarray[i].iPrice);
	  console->Printf(KMsgNewLine);
	}
	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgModify);
	_LIT(KNewFruit,"apple");
	TBuf<10> buf(KNewFruit);
	rarray[1].iName = buf.Alloc();	//修改數(shù)組第二個(gè)元素的名字
    for(i=0;i<rarray.Count();i++)
	{
	  console->Printf(KID,rarray[i].iID);
	  console->Printf(KName);
	  TPtr ptr = rarray[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,rarray[i].iPrice);
	  console->Printf(KMsgNewLine);
	}
	delete rarray[1].iName;	

	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgFind);
    TInt findPos;			
    TFruit S1(1,buf1,1.5);	
    if((findPos=rarray.Find(S1))!=KErrNotFound)		//在數(shù)組中查找名buf1的水果,如果有就打印該水果的名字
	{
	  TPtr ptr = rarray[findPos-1].iName->Des();
	  console->Printf(_L("Find!!"));
      console->Printf(ptr);
	  console->Printf(KMsgNewLine);
	}
    TFruit S2(0,buf2,0);
	TIdentityRelation<TFruit> find(FindFruitName);
    if((findPos=rarray.Find(S2,find))!=KErrNotFound)//在數(shù)組中查找名buf1的水果,如果有就打印該水果的名字
	{
	  TPtr ptr = rarray[findPos].iName->Des();
	  console->Printf(_L("Find!!"));
      console->Printf(ptr);
	  console->Printf(KMsgNewLine);
	}

	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgSortID);
    TLinearOrder<TFruit> sort1(CompareFruitID);	//按照水果的ID排序
    rarray.Sort(sort1);
    for(i=0;i<rarray.Count();i++)
	{
	  console->Printf(KID,rarray[i].iID);
	  console->Printf(KName);
	  TPtr ptr = rarray[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,rarray[i].iPrice);
	  console->Printf(KMsgNewLine);
	}

	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgSortName);
    TLinearOrder<TFruit> sort2(CompareFruitName);	//按照水果的名字排序
    rarray.Sort(sort2);
    for(i=0;i<rarray.Count();i++)
	{
	  console->Printf(KID,rarray[i].iID);
	  console->Printf(KName);
	  TPtr ptr = rarray[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,rarray[i].iPrice);
	  console->Printf(KMsgNewLine);
	}
	
	rarray.Reset();
	CleanupStack::PopAndDestroy();
}		 
void FruitFixFlat()
{
	CArrayFixFlat<TFruit>* fixflat;		//用CArrayFixFlat存儲(chǔ)數(shù)據(jù)
	fixflat= new (ELeave) CArrayFixFlat<TFruit>(5);	//申請(qǐng)空間

	_LIT(KFruit1,"watermelon");
	TBuf<12> buf1(KFruit1);
	_LIT(KFruit2,"peach");
	TBuf<10> buf2(KFruit2);
	_LIT(KFruit3,"orange");
	TBuf<10> buf3(KFruit3);

	TFruit fruit1(1,buf1,1.5);
	TFruit fruit2(2,buf2,2.8);
	TFruit fruit3(3,buf3,1.2);
	
	fixflat->AppendL(fruit1);		//將數(shù)據(jù)添加到數(shù)組中
	fixflat->AppendL(fruit2);

    for(TInt i=0;i<fixflat->Count();i++)	//顯示數(shù)組中所有的數(shù)據(jù)
	{
	  console->Printf(KID,(*fixflat)[i].iID);
	  console->Printf(KName);
	  TPtr ptr = (*fixflat)[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,(*fixflat)[i].iPrice);
	  console->Printf(KMsgNewLine);
	}

	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgInsert);
	fixflat->InsertL(0,fruit3);			//向數(shù)組插入數(shù)據(jù),插入數(shù)據(jù)是數(shù)組的第一個(gè)元素
    for(i=0;i<fixflat->Count();i++)
	{
	  console->Printf(KID,(*fixflat)[i].iID);
	  console->Printf(KName);
	  TPtr ptr = (*fixflat)[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,(*fixflat)[i].iPrice);
	  console->Printf(KMsgNewLine);
	}

	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgModify);
	_LIT(KNewFruit,"apple");
	TBuf<10> buf(KNewFruit);
	(*fixflat)[1].iName = buf.Alloc();	//修改數(shù)組第二個(gè)元素的名字
    for(i=0;i<fixflat->Count();i++)
	{
	  console->Printf(KID,(*fixflat)[i].iID);
	  console->Printf(KName);
	  TPtr ptr = (*fixflat)[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,(*fixflat)[i].iPrice);
	  console->Printf(KMsgNewLine);
	}
	delete (*fixflat)[1].iName;

	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgDelete);
	fixflat->Delete(1);				//刪除數(shù)組第二個(gè)元素
    for(i=0;i<fixflat->Count();i++)
	{
	  console->Printf(KID,(*fixflat)[i].iID);
	  console->Printf(KName);
	  TPtr ptr = (*fixflat)[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,(*fixflat)[i].iPrice);
	  console->Printf(KMsgNewLine);
	}

	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgFind);
	TKeyArrayFix nameKey(_FOFF(TFruit,iName),ECmpNormal);
    TInt findPos;
    TFruit S(2,buf2,2);		//在數(shù)組中查找名為buf2的元素,如果有打印該水果的名字
    if(fixflat->Find(S,nameKey,findPos)!=KErrNotFound)
	{
	  TPtr ptr = (*fixflat)[findPos-1].iName->Des();
	  console->Printf(_L("Find!!"));
      console->Printf(ptr);
	  console->Printf(KMsgNewLine);
	}

	console->Printf(KMsgPressAnyKey);
	console->Getch();
	console->Printf(KMsgSortID);
    TKeyArrayFix IDKey(_FOFF(TFruit,iID),ECmpTInt32);
    User::LeaveIfError(fixflat->Sort(IDKey));	//按照水果的ID排序
    for(i=0;i<fixflat->Count();i++)
	{
	  console->Printf(KID,(*fixflat)[i].iID);
	  console->Printf(KName);
	  TPtr ptr = (*fixflat)[i].iName->Des();
	  console->Printf(ptr);
      console->Printf(KMsgNewLine);
	  console->Printf(KPrice,(*fixflat)[i].iPrice);
	  console->Printf(KMsgNewLine);
	}
	delete fixflat;
}

// Do the example
LOCAL_C void doExampleL()
{		
	console->Printf(_L("*****Rarray*****\n"));
	FruitRArray();
	console->Printf(_L("\n***CArrayFixFlat***\n"));
	FruitFixFlat();
}

 	



	
	

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产丝袜欧美中文另类| 精品电影一区二区| 国产精品水嫩水嫩| 日本aⅴ精品一区二区三区 | 色婷婷久久99综合精品jk白丝| 国产成人在线观看免费网站| 色吧成人激情小说| 国产色一区二区| 麻豆精品一区二区av白丝在线| 韩国欧美国产1区| 欧美午夜一区二区三区| 国产精品福利av| 国产精品一品视频| 日韩免费电影一区| 天堂在线一区二区| 欧美色老头old∨ideo| 亚洲女同一区二区| thepron国产精品| 亚洲国产高清aⅴ视频| 精品在线亚洲视频| 欧美一卡2卡3卡4卡| 日韩av一区二区三区四区| 欧美三级蜜桃2在线观看| 亚洲丝袜制服诱惑| 波多野结衣的一区二区三区| 久久久国产精华| 国产综合色视频| 欧美电影免费观看高清完整版在线 | 久久亚洲免费视频| 久久精品99国产精品日本| 欧美精品一卡二卡| 日韩国产成人精品| 欧美日韩一区二区三区免费看| 精品国产精品网麻豆系列| 日韩国产在线一| 欧美日韩亚洲高清一区二区| 一级精品视频在线观看宜春院| 久久疯狂做爰流白浆xx| 欧美丰满少妇xxxbbb| 亚洲国产综合色| 欧美日韩精品二区第二页| 亚洲国产中文字幕在线视频综合| 国产成人午夜精品影院观看视频 | 欧美影视一区在线| 中文字幕亚洲一区二区av在线| 麻豆精品视频在线观看视频| 日韩美女一区二区三区四区| 日韩激情中文字幕| 欧美电影免费观看完整版| 国内国产精品久久| 国产三级精品在线| 99久免费精品视频在线观看| 亚洲美女在线一区| 欧美性xxxxxxxx| 日韩影院在线观看| 久久影院电视剧免费观看| 国产不卡视频一区| 亚洲视频在线一区| 欧美色区777第一页| 蜜乳av一区二区| 久久久久9999亚洲精品| jlzzjlzz国产精品久久| 一区二区三区在线免费视频| 欧美三级日本三级少妇99| 视频一区在线播放| 精品国产伦一区二区三区观看方式 | 精品国产伦一区二区三区免费| 亚洲成人综合在线| 日韩欧美一级二级三级| 国产精品69毛片高清亚洲| 中文乱码免费一区二区 | 一区二区三区欧美在线观看| 欧美男同性恋视频网站| 久久成人18免费观看| 中文一区在线播放| 欧美性猛交xxxxxxxx| 久久99精品久久久久婷婷| 国产婷婷色一区二区三区在线| 九九九精品视频| 中文字幕在线一区免费| 欧美日韩专区在线| 国产福利一区二区三区视频在线 | 在线观看视频欧美| 免费观看在线综合| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧美一区二区三级| 国产a区久久久| 亚洲第四色夜色| 国产日韩欧美亚洲| 欧美性猛交一区二区三区精品| 亚洲女厕所小便bbb| 欧美一区欧美二区| 成人禁用看黄a在线| 婷婷久久综合九色综合伊人色| 欧美在线免费视屏| 麻豆成人免费电影| 伊人夜夜躁av伊人久久| 精品国一区二区三区| 91黄色免费观看| 国产精品夜夜爽| 无吗不卡中文字幕| 中文字幕一区二区日韩精品绯色| 91在线一区二区| 免费成人在线观看视频| 一区二区三区在线视频观看| 久久久久久久精| 91精品国产免费久久综合| 99久久精品国产毛片| 精品亚洲国内自在自线福利| 一区二区欧美在线观看| 国产色产综合产在线视频| 欧美日韩高清在线播放| 不卡av在线网| 国产一区91精品张津瑜| 亚洲一区二区三区四区中文字幕| 欧美日韩极品在线观看一区| 99精品欧美一区二区三区综合在线| 亚洲视频每日更新| 久久久久成人黄色影片| 91精品国产一区二区三区香蕉 | 洋洋av久久久久久久一区| 欧美精品一区二区三区一线天视频| 国产精品18久久久久久久网站| 欧美激情中文不卡| 日韩免费看的电影| 6080日韩午夜伦伦午夜伦| 色婷婷综合久久久中文字幕| 国产真实乱对白精彩久久| 天天综合天天综合色| 亚洲精品视频一区| 国产精品福利一区二区| 中文字幕精品一区二区三区精品| 欧美专区亚洲专区| 不卡一二三区首页| 国产成人综合亚洲91猫咪| 国产中文字幕精品| 久久精品久久精品| 美腿丝袜在线亚洲一区| 日韩高清不卡一区二区三区| 亚洲成av人影院| 亚洲自拍欧美精品| 亚洲精品乱码久久久久久| 亚洲三级在线播放| 国产精品美女久久久久aⅴ国产馆| 欧美性色欧美a在线播放| 一本色道综合亚洲| 99精品欧美一区二区蜜桃免费| 性做久久久久久久免费看| 亚洲一区在线免费观看| 亚洲精品视频免费观看| 亚洲综合一区二区三区| 亚洲宅男天堂在线观看无病毒| 精品国产一区二区三区av性色| 91丨九色丨蝌蚪丨老版| 99精品视频一区| 色婷婷国产精品综合在线观看| 久久99蜜桃精品| 极品少妇xxxx偷拍精品少妇| 紧缚奴在线一区二区三区| 国产麻豆精品视频| 国产麻豆成人精品| 国产99久久久国产精品潘金 | 中文字幕高清不卡| 欧美激情综合五月色丁香| 日本一区二区成人在线| 国产精品人成在线观看免费| 国产精品成人免费| 一区二区三区高清不卡| 亚洲第一精品在线| 日本不卡一区二区三区高清视频| 有码一区二区三区| 亚洲国产综合91精品麻豆| 五月天久久比比资源色| 日本不卡的三区四区五区| 国产一区二区三区在线观看免费 | 欧美日韩一区高清| 欧美另类一区二区三区| 欧美一级黄色大片| 久久婷婷国产综合精品青草| 中文字幕av免费专区久久| 亚洲精品美腿丝袜| 天天影视涩香欲综合网| 久久爱www久久做| 波多野结衣在线aⅴ中文字幕不卡| 国产一区二区伦理| 成人黄色在线看| 欧美性极品少妇| 欧美mv和日韩mv的网站| 欧美国产激情一区二区三区蜜月| 日韩精品资源二区在线| 久久精品亚洲精品国产欧美| 国产精品嫩草影院av蜜臀| 一区二区欧美在线观看| 精品一区二区日韩| 97精品国产露脸对白| 91精品国产乱| 国产精品久久夜| 性感美女久久精品| 国产精品系列在线观看| 欧美在线一二三|