|
楼主 |
发表于 2013-5-24 22:24:12
|
显示全部楼层
FILE *fp = fopen("d:/Work_Kanzt/encrypted", "r+");
char inputStr[100] = {0};
char *start = NULL;
char *end = NULL;
int encrypt[2][11] = {0};
int i = 0;
int j = 0;
while (NULL != fgets(inputStr, 100, fp))
{
printf("%s\n", inputStr);
start = strchr(inputStr, '=');
do
{
encrypt[i][j++] = strtol(start+1, &end, 0);
printf("key=%d\n", encrypt[i][j-1]);
printf("end=%p, *end=%c\n", end, *end);
start = end;
} while (*end == ',');
printArray(encrypt[i], 11);
i++;
j = 0;
} |
|