回复 6楼 吹水佬
主要是我现在想定义完数组往每个字符串写东西
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main(){
char** fff=NULL;
if ((fff = (char**)calloc(10, sizeof(char*))) == NULL) {
printf("\n Error: failed in Calloc filegname");
exit(69);
}
if ((fff = (char**)calloc(10, sizeof(char*))) == NULL) {
printf("\n Error: failed in Calloc filegname");
exit(69);
}
int i;
for (i = 0; i < 10; i++) {
fff[i] = "sd";
printf("
%s
", fff[i]);
}
for (i = 0; i < 10; i++) {
printf("fff");
sprintf(fff[i],"%d", i);
printf("
%s
", fff[i]);
printf("ddd");
}
free(fff);
fff = NULL;
return 0;
}
我现在到sprintf那里出错了,不知道怎么解决