示例代码
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string s1="123456";
string s2="abc";
int **count=new int*[s2.size()];
for (int i=0;i<s2.size();i++)
{
count[i]=new int[s1.size()];
memset(count[i],0,sizeof(int)*s1.size());
}
for (int i=0;i<s2.size();i++)
{
for (int j=0;j<s1.size();j++)
{
cout<<count[i][j]<<endl;
}
}
for (int i=0;i<s2.size();i++)
{
delete[]count[i];
}
delete []count;
cout<<"finish"<<endl;
int end;
cin>>end;
}
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string s1="123456";
string s2="abc";
int **count=new int*[s2.size()];
for (int i=0;i<s2.size();i++)
{
count[i]=new int[s1.size()];
memset(count[i],0,sizeof(int)*s1.size());
}
for (int i=0;i<s2.size();i++)
{
for (int j=0;j<s1.size();j++)
{
cout<<count[i][j]<<endl;
}
}
for (int i=0;i<s2.size();i++)
{
delete[]count[i];
}
delete []count;
cout<<"finish"<<endl;
int end;
cin>>end;
}