Im having problems with segmentation faults and I also need help with case 3 del
ID: 3659919 • Letter: I
Question
Im having problems with segmentation faults and I also need help with case 3 deleting a ship from the arrat thx for the help. #include<string.h>#include<stdio.h>
#include<stdlib.h>
typedef struct
{
char name[25];
char ship_type; // Im having problems with segmentation faults and I also need help with case 3 deleting a ship from the arrat thx for the help. #include<string.h>
#include<stdio.h>
#include<stdlib.h>
typedef struct
{
char name[25];
char ship_type; // Im having problems with segmentation faults and I also need help with case 3 deleting a ship from the arrat thx for the help. #include<string.h>
#include<stdio.h>
#include<stdlib.h>
typedef struct
{
char name[25];
char ship_type; //
Explanation / Answer
All of ur scanf's are correct, so specify the line where u are encountering segmentation fault , by the way segmentation fault occurs due to incorrect allocation of memory to variables,like calling an 6th element of a 5 member-ed array. The case 3 has been modified case 3: printf("Please enter ship name you wish to delete: "); scanf("%s",&searchName); int flag; // this will store trhe lcoation of the position Of the ship for(j=0;jRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.