yeah i get it.thanks!
Type: Posts; User: iunah
yeah i get it.thanks!
i get it. thanks. :)
i need to create a function (inside bst.h) that will save the contents of the bst (before deleting the whole bst when the program would be terminating) in a file, containing the numbers in the bst in...
sorry for the late reply..
are you pertaining to this part?
else{
if(ptr == ptr->parent->left){
ptr->parent->left = ptr1;
//should I insert something here...
this is my code snippet:
void deletenodebst(bst **rootptr,bst *node) {
bst *ptr, *ptr1;
if(node->left==NULL || node->right==NULL){
ptr = node;
}else ptr = successorbst(node);
my apologies..
what happens is that even though a matching name is already on the list, it would still be appended..
ok.. my bad.. thanks for correcting me
but how about the problem?
okay.. for example:
FIle contains:
John
Matt
Philip
then the contents of the array would be that 3 names.. then the user has an option to add a name:
Add a name: jOhn
i tried passing the original values but still, nothing happened.. where do you think is the problem?
it was instructed that index 0 of the array will not be used..
EDIT: my apologies, that was a typo
else is not included..
i'm saying that if ever temp and temp2 is 0 (that is, if they are the same), comp's value will change and that would mean the user cannot input the name he wants because it is already existing in the...
my goal is to retrieve names from a file, save it to an array and save its changes as to program terminates. also, the user cannot add a name that already exists, despite of its case. can someone...
at last, I found a way to dump that line on scanf.. ( i used a separate function just for that dumping)
thanks for all the help! :)
until then I sleep..
yes, it does have a scanf before that case-statement.. but it only asks for an int "choice" on the "menu".. how can I use fgets + sscanf for that? or rather, how can I clean up the whitespace that...
this is a larger block of my code
int pos;
char name[30];
printf("Enter name: ");
fgets(name,30,stdin); //sorry.. maxChar is #define-d as 30 in my code.. :)
printf("Enter position: ");
thanks for the FAQ. :)
i've seen some "solutions" around:
-i've read others saying about an fpurge(stdin)..
-using fgets then sscanf..
which do your recommend? or can you recommend other...
char name[30];
printf("Enter name: ");
fflush(stdin);
fgets(name,30,stdin);
what I want is to save a string (with whitespaces) to "name" because "name"s from the user will be stored in...
How can I pass an array of pointers? Please help... here's a piece of my code...
typedef struct node1 {
int cell;
struct node *prev;
struct node *next;
} box;
typedef struct node2 {
Yes.. and it worked perfectly..
Well it's just a part of a HUGE code I'm currently working on..
Again, thanks for all the help..
I think I got it.. thanks for all the help
typedef struct node2 {
char name[10];
struct node *move; //i removed '2' from node
} person2;
but, what I want to do is to traverse person2 on person...
what should I do?
do I have to typecast one of the sides?
thanks, but, can you please discuss more on solving this problem? i'm still new to C.. sorry..
i'm getting this error... i don't know what to do.. please help...
typedef struct node {
int age;
struct node *prev;
struct node *next;
} person;
Can someone please help me in converting handleEvent() method (which is now deprecated) to processEvent()? I don't know how.. please help..
I've included the necessary files on the zip folder...