给⼀个⼆维数组随机赋值#include <stdio.h>
#include <iostream>
void main()
{
const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
const int dimon = 10;
const int size = 11;
char **data =  new char*[dimon*size];
for (int i = 0; i < dimon; i++) {
data[i]=new char[size];
memset(data[i],0,size);
}
for (int i = 0; i < dimon; i++) {
memcpy(data[i],"Gh0st",5);
for (int j = 5; j < size; j++) {
data[i][j] =alphanum[rand() % (sizeof(alphanum) - 1)];
}
}
getchar();
return;
}
运⾏后,在 immidiatly  窗⼝可以查询到
data[0]
0x008b6f00 "Gh0stfrAQBcýýýý««««««««þîþîþîþîþ"
data[1]
0x008b45e8 "Gh0st8Wsa1xýýýý««««««««þ"
data[1]
0x00b745e8 "Gh0st8Wsa1xýýýý««««««««þ"
data[2]
0x00b74630 "Gh0stVPfvJcýýýý««««««««þ"
怎么给数组赋值data[3]
0x00b7af48 "Gh0strgRYwTýýýý««««««««þ"
data[4]
0x00b7af90 "Gh0stiizs2týýýý««««««««þ"
data[5]
0x00b7b9d0 "Gh0strQF69Aýýýý««««««««þ"
data[6]
0x00b7ba18 "Gh0stzBlax3ýýýý««««««««þ"

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。