So I’m just learning C, my case is to make n the number of arrays, but when I try to run the program, the program always stops when I just enter 1 number, is there an error in my code?
this is my code :
#include <stdio.h>
int main(void) {
int p;
scanf("%d", &p);
int t_p[p];
for (int i = 0; i < p; i++) {
scanf("%d", &t_p[i]);
}
return 0;
}
I just try different method
New contributor
Seycht is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.