#include "stdafx.h"
#include "stdlib.h"
#include "time.h"
#include "iostream.h"
#include "string.h"
#include<windows.h>
//#include "afx.h"
#include<list>
using namespace std;
struct data
{
long m_nAdr;
char m_cCharacter[300];
int len;
};
class listbuff
{
//CStringList stringlist;//用这个CStringList 也点不出它的成员函数出来
list<string> stringlist;
public:
void putlist(data &DT);
void printflist();
};
void listbuff::putlist (data &DT)
{
//stringlist.AddTail(DT.m_cCharacter);
stringlist//需要想stringlist里面加入DT这个结构里面的m_cCharacter成员
}
/*
void listbuff::printflist ()
{
CString str_output;
for(int t=0;t<stringlist.GetCount();t++)
{
str_output=str_output+stringlist.GetAt(stringlist.FindIndex(t));
}
cout<<str_output<<endl;
}*/
data QUZHI(char *l_pszSrc,int l_nSize)
{
data l_RV;
int l_nAdr=0;
Sleep(1000);
srand(time(0));
l_RV.m_nAdr=(long)&l_pszSrc[rand()%l_nSize];
int i=0;
int k=(rand()%l_nSize)+1;
l_RV.len=0;
for(i=0;i<k;i++)
{
l_RV.m_cCharacter[i]=*(char *)l_RV.m_nAdr++;
}
l_RV.m_cCharacter[i]='\0';
l_RV.len=strlen(l_RV.m_cCharacter );
return l_RV;
}