Paste
#81964: Untitled ASCII paste by 203.114.244.88
#include <stdio.h>
#include <stdlib.h>
#define MAX_Y_NUM 4096
typedef struct
{
char s1[128];
char s2[128];
}detail_stru;
typedef struct
{
int num;
detail_stru detail[128];
} test_stru;
int test(test_stru * p_data)
{
int i = 0;
/* char temp[128][MAX_Y_NUM] = { {0} }; */
char * tmp[128];
for (i = 0; i <= 128; i++)
{
tmp[i] = malloc (sizeof (p_data->detail[i].s1));
}
/* 当然还有更优化的方法.你看看这个行不行先 */
int test_num = 0;
while (i < p_data->num)
{
sprintf(temp[i], "%s, %s", p_data->detail[i].s1, p_data->detail[i].s2);
i++;
}
temp_num = p_data->num;
if (temp_num > 0)
{
another_test(temp, test_num);
}
return 1;
}