#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main() {
char* *szdata;
int count = 0, maxlenth = 0;
scanf("%d*c", &count);
szdata = (char**)malloc(sizeof(char*)*count);
scanf("%d*c", &maxlenth);
for (int i = 0; i < count; i++) {
szdata[i] = (char*)malloc(sizeof(char) * (maxlenth + 1));
printf ("input");
scanf("%s", szdata[i]);
}
for (int i = 0; i < count; i++) {
puts(szdata[i]);
}
}
If you change the printf
in the first for
statement to gets_s
, the input is omitted once, so why is that? ㅜ<
printf is the output function, and get_s is the input function. I don't know if you have putts_s, but try it with that function
© 2024 OneMinuteCode. All rights reserved.