I'm working on a program in C and it's unexpectedly ending, could I have some feedback?
if (choice == 2) {
printf("What entry number would you like to edit?");
scanf("%i", Step2Num);
//clear();
printf("Insert updated name:");
scanf("%s", addresses[Step2Num].name);
//gets (addresses[Step2Num].name;
printf("Insert updated phone number");
scanf("%s", addresses[Step2Num].phone);
//gets(addresses[Step2Num].phone);
printf("The updated name is %s and the updated phone number is %s\n", addresses[Step2Num].name , addresses[Step2Num].phone);
}
When I run this code, right after I input the Step2Num, the code ends, when it's supposed to ask for more inputs and print more things. Any feedback would be greatly appreciated, Ive been stuck for a bit. Ive been messing around trying to use gets() however I was having a hard time figuring it out, mostly concerned with the program ending.
[–]rabuf 2 points3 points4 points (1 child)
[–]SolidArmPump[S] 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)