指针与结构体
#include<stdio.h>
#include<stdlib.h>
#include <string.h>
void Lns_02();
int main() {
Lns_02();
return 0;
}
typedef struct {
long long QQ;
char *pPass;
int passLen;
} Row;
typedef struct {
Row *pRow;
int rowNum;
}Array;
void Lns_02() {
Array *pArray = (Array *)malloc(sizeof(Array));
(*pArray).rowNum = 10;
(*pArray).pRow = (Row *)malloc((*pArray).rowNum * sizeof(Row));
pArray->pRow[0].QQ = 955375599;
pArray->pRow[0].passLen = 10;
pArray->pRow[0].pPass = (char *)malloc(sizeof(char) * pArray->pRow[0].passLen);
strcpy(pArray->pRow[0].pPass,"linchangjian");
strcpy((*(pArray->pRow + 0)).pPass , "linchangjian");
strcpy((*((*pArray).pRow + 0)).pPass , "linchangjian");
}