I just started coding. I haven't been able to input a string and print it out yet, so I was going to try DevC I created the code and entered it. But the launcher didn't respond I turned on the debugging and it says segmentation error.
Please reply easily
This is the code
#include <stdio.h>
#include <stdlib.h>
int main()
{
char* q;
printf("Type your name.\n");
scanf("%s", &q);
printf("Your name is: %s\n", q);
return 0;
}
char q[1024];
// ...
scanf("%s", q);
// ...
You have to do it like this.
The code of the questioner is the same as the room key without preparing a room for a person. People came from scanf
and they couldn't get in and made a claim when they tried to put it in the key.
It's easy, right?
© 2024 OneMinuteCode. All rights reserved.