Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*char z2[15];
- system("cls");
- printf("1- by name\n2- by id\n");
- printf("your choice: ");
- scanf(" %[^\n]s",z2);
- int x2=atoi(z2);
- if(x2==1)
- {
- system("cls");
- printf("Enter name: ");
- while((c= getchar()) != '\n' && c != EOF);
- gets(name);
- node_id* temp = search_name(&root_name, name);
- if (temp != NULL)
- {
- id = temp->id;
- }
- if(temp == NULL)
- printf("NOT FOUND.\n\n");
- else
- {
- root_id = delete_id(root_id, id);
- root_name = delete_name(root_name, name);
- printf("\n%d %s has been deleted succesfuly.\n\n",id,name);
- }
- }
- else if(x2==2)
- {
- system("cls");
- printf("Enter id: ");
- scanf("%d", &id);
- node_id* temp = search_id(&root_id, id);
- if (temp != NULL)
- {
- strcpy(name, temp->name);
- }
- if(temp==NULL)
- printf("NOT FOUND.\n\n");
- else
- {
- root_id = delete_id(root_id, id);
- root_name = delete_name(root_name,name);
- printf("\n%d %s has been deleted succesfuly.\n\n",id,name);
- }
- }
- else
- {
- system("cls");
- printf("enter a valid choice.\n");
- break;
- }
- break;*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement