~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

All the programmers come under one roof at Daniweb...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yes -- like I mentioned in my previous post, you can leave out the complicated stuff of balancing the tree since the it doesn't seem to be the focus of your project.

As far as the third case is concerned, assuming you have the pointer to the node to be deleted with you:

// here we accept a reference to the node pointer type
// this relieves you from passing the function a pointer to pointer
// thereby making the deletion easy.
void delete_node( Node*& node )
{
    Node*& tmp = node ;
    
    if( node->left == NULL )
    {
         node = node->right ;
         delete tmp ;
    }
    else if ( node->right == NULL )
    {
         node = node->left ;
         delete tmp ;
    }
    else
    {
         // here comes the third case          
         tmp = node->left ;
         while( tmp->right != NULL )
         {
              tmp = tmp->right ;
         }
          node->value = tmp->value ;
          delete_node( tmp ) ;
}

Hope it helped , bye.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I am a responsible adult, there isn't a mean bone in my body and I haven't provoked nor misrepresented anyone. I agree with your eye for an eye quote. Not looking to stab anyone's eye but I will protect my eyes.

Oh come one, I wasn't talking about you being mean, its just that school kids would not have understood the gravity of the quote which I was about to say...

Hope you understand that metaphor......Justine

Yes I understand -- you have your own reasons..

It was nice talking to you, take care....

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Assuming that you are not one of those school kids but a responsible adult, I would say only one thing to end my part here:

An eye for an eye makes the whole world blind

Hope you understand....

Thank you.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Too many things to say:

1. Don't use void main( ) , its not standard, use int main( ) instead.

2. If you are using C++ why keep old C style headers.

// instead of 
#include <string.h> 
// use
#include <string>
using namespace std ;

The same goes for the other standard C++ headers.

Don't use conio.h its non portable and present only in Turbo C. Use iostream instead for for input and output.

Therefore change your header part to:

#include <iostream>
#inclue <cstring> // for C style strings
#include <fstream>
#include <string> // for the string class

2. The whole reason of using C++ and OOP's is to provide abstraction and an easy interface for invoking core functionality. Instead of delegating all your functionality to the class you have added all the functionality in main itself.

3. Why are you using char[40] when a safe and cleaner options of string is there for you?

4. Why create a static or fixed array of Person objects when you can create Person objects on the fly and store them in C++ vectors.

So in the end I would say that you have really written C using C++. Try thinking about the design on a peice of paper and working all the details out.

Repost if any doubts.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

the best sword

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

yesterday -> tomorrow never dies

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Naa..this is not similar to rotation. Rotation is used for balancing the binary tree which becomes unbalanced after repeated deletions from the BST, and for the purpose of balancing we use AVL trees, Red Black tree and many others -- but I don't think you should complicate matters by taking these things into consideration for the time being.

And now for the deletion part -- there are actually three cases:
1. The node has no children : In this case you can directly remove the node.

2. The node has one child: In this case you just replace the node with the child.

3. The node has two children: This is a bit tricky to handle and toughest among all. In this case you need to delete the node keeping in mind the nature or property of BST is maintained.

Suppose if the node is N then we replace the value of N with either its in-order successor (the left-most child of the right subtree) or the in-order predecessor (the right-most child of the left subtree).

For an excellent simulation you can look here.

HOpe it solved your problem.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

We all know that there are cruel people in this world. Those that enjoy demeaning others for personal gratification. Others do this by constant argument and manipulation. I seriously wish to get to know "good people" on Dani Web. If I take a stand on something and you disagree that's ok, my problem is when people misrepresent what you say and put it in their own context thus demeaning you in the process. That is just wrong and noone deserves to be walked on......Justine

What you are going through would be wrongly categorized as cruel...Please don't say that any member of daniweb is cruel -- they might be inconsiderate, sarcastic, egoistic but please no cruel.

What can I say? I have a bad habit of getting to know people by provoking them.

But what is the point in knowing someone by provoking them when they will hate the very sight of your post....*sigh*

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Are you trying to see if Narue can be pushed even further?
Niek

Naa...its not like that, I don't hold anything against the other female members.

But you have to admit her way of posting sure was unique, I sure miss her.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

think over the

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

So at last

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I dont think the OpenGL code depends on the compiler but on OS --- yes.

If you need to run the same code on different OS's you can head over to NeHe where he has provided code snippets for different OS's and different compiler (OpenWatcom etc. )

IMHO, you are better off writing code which is portable which won't be difficult since OpenGL itself if platform independent.

If any more doubts repost.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Flooding causes...well....flooding :D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The female I like the most on this board is Miss Innana -- really cool, all answers picture perfect, being helpful to all the people and above all stays away from debates..:D

Damn after reading the recent threads from other female members, I sure miss her.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I am far from being a "feminist or boorish" If that's how people see you at work then you need to look at yourself. I encourage, love and support men. I have never made a comment comparing one gender dominating the other. Simply stated facts, not putting either side down. Your thinking is serious flawed...That's all I'm done with this....Justine

Hello.

There is one thing which you are missing here -- this is a public forum where anyone is free to post his opinions unless they are racist, against a particular religion or directly hurt someone...

When you create a thread ( esp in the Geek's Louge ), you have to accept that many people will come and express their opinions of which you won't like many.

Free flowing ideas from the different parts of the world is what keeps this forum alive. I hope you catch the drift.

Thank you.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

AH...a mistake on that site..

No problem take a look here.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Here you go.

Next time just put the whole phrase in google and you would get results which would surprise you. (I mean you can easily get answers using Google)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

@Justine

I hope you realise that the game development field of Software development is very demanding. I don't want to seem pessimistic, but I am yet to see a professional game developer who didn't start coding at the age of 14-16.

To put it in a mild way, the people who develop games are maniacs...so if she wants to start game development at the age of 28 then good luck from me. (here I am assuming about PC game development using C++ / DirectX).

If your friend really has the talent, she can perform better in the other fields of software development like Web development ( PHP + MySQL ) wherein you get a job easily and at the same time you cna do freelancing given the volume of projects involving Webdevelopment.

Hope it helped, bye.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I presume SOS may not have the fast internet access we have here in USA. 50Mg can be a lot for slow dial-up modems or whatever people in India use.

Yes, ditto. Though I don't use a modem( its broadband ), but its pretty slow as compared to the people living in UK (10Mbps :eek:) and US ( 2Mbps).

That's why I request people to post their entire code so that I don't have to move back and forth between pages...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

*sigh* not everyone has the privelege of sitting behind a high speed connection.
It would take me well over 1 hour to download the massive installation package.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Men are better at some things by nature and women are better at some things.

The same thing can be observed among people of the same sex.

Please point out where I said otherwise.

I didn't quote you on this stmt, so I wasn't contradicting you, just saying my mind.

We can narrow it down even more. People who eat a healthy breakfast have been proven to perform better than people who don't. Where do you draw the line?

I don't quite understand what breakfast has to do with discussion. Just wanted to say that doing something better than other is not limited to women but to all the humans as whole.

Because you don't agree with it?

I don't think the point is all about coming to a common agreement, but about expressing what does equality of sexes mean of each one of us.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Agreed -- Men and Women are different in different aspects, emotionally, physically etc. but that doens't mean that women can't do a peice or work which men can.

Also performance as you say is not universal evev in the case of males, some are good at somethings some are not, its not just a thing associated only with women.

Bottom -- as far as work is concerned it has no sex barriers, be in men or women, though the quality of work may differ which is quite understood since we all are unique.

Equality is impossible

With a broken defination of equality, it sure is.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Away from the sun.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

For shared memory implementation on windows you can look here and here.

Hope it helped, bye.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Victory comes to those who don't believe in giving up.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

OMG, 55 MB, thats too much for experimentation...;)

But still will try when I get time and give you the feedback..

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hmm...here is what I think you should do:

1. Always keep a guard condition while making header files which does away with the problem of recursive inclusion of headers. Something like:

#ifndef TGA_H_
#define TGA_H_

// your header file here

#endif

2. Don't know why but your loop looks fishy:

while ( In == NULL )
    {
        cout << "open failure. Please check the file's location and try again.\n";
        cout << "What is the map file's name? ";
        cin >> sMap;
        
        In.open( sMap.c_str() );
    }

Try removing the loop and ducking out if the fle is not found.

3. Tada..and this I think according to me is the culprit:

while ( tempChar != '/n' ) // loop to find the row and col numbers.

Just to let you know there is no such thing as /n, it must have been a typo mistake since you should write \n if validating against a newline character.

4. Oh yes...don't use system("pause") , getchar( ) achieves the same thing without putting portability at stake....

FireSBurnsmuP commented: thanks a lot, that helps +1
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

How about posting the things you have done ?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

District cricket is a good excuse to have a drink

Drink all the booze you want to.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You must be sitting behind a firewall I suppose. THe same problem happens with me but on a different site.

In that case I just turn off the firewall and post and it works out well. Or try changing the setting in your firewall for Daniweb and then see if it works.

Hope it helped, bye.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

*spills the bucket of cold water on both Narue and Justine*

*Hands them both some dry towels and glowers at Chaky* :cheesy:

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

"where is my...

(thanks you mentioned the tough word, otherwise I would have got to go to Dictionary.com :D )

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Knights of Templar -> Neverwinter Nights

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Is that a good thing or a bad thing? :)

I think it's an awesome thing :)

Yeah Miss Dani has already asked her Web site graphics designer to make a new badge for you which reads "SPAMMER". (joking)
:D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Here is a small example on how to do it, you can easily mould it to your needs:

#include <iostream>
#include <cstring>

int main()
{
    char* digit[] = { "1", "2", "3", "4" } ;
    char* number[] = { "one", "two", "three", "four" } ;

    for( int i = 0; i < 4; ++i )
    {
        std::cout << digit[i] << " is equivalent to " << number[i] << std::endl ;
    }
    return 0 ;
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

went to his

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

one useful purpose.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

hi veena thank u so much for the code . yar but the problem is i want
for scintific calculator.
aur is code mei bhi kuch error tha.
tomoro i will tell u the error ok
bye take care

You should keep in mind that this is an international forum where people form different parts of the world come to gain some knowledge.

Please don't talk in any other langauge other than English since not many people understand Hinglish here (hindi + english). Read the rules as suggested by Mr. WaltP.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

could be used

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Keira Knightley -> Knights of the Republic

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

looking for some

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

But the above problem can't be solved without arrays if you want to store the scores for later display.

Maybe you should brush up a bit on arrays from your text book and then try to attempt the problem.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Paste your entire question as it is word to word and then maybe I would be able to help you out because your description is rather vague.

And btw if you don't know what you are doing, how come did you write his code ?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Pirate -> Curse of the Black Pearl

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hmm...when you say you are having problem what does it actually mean ?

Some more things, if your program wants to calculate the average, where is the array which holds the values or are you accepting input from a file ?

In your get_data( ) function you have :

final = static int which has value between 29 and 49.
What is the significance of this in the algorithm ?

Also you are not seeding the random number so your random numbers would be repetitive and not quite random in nature as you would expect them to be.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

in the end..

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Green and black's chocolate -> Decayed teeth :D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Pretty neat PHP coding...:D

Maybe the guys at Zend should give you a reward or something...hehe

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hello to all Gamedevelopers out there. Many of your have already wanted to get into game development but came to a stand still due to the lack of resources.

Please don't post Spam or Thank you posts in this thread since this is meant to be used as a guide for all beginners. I hope you understand this.

My first post will deal with starting game development using external libraries and API's since it doesn't make sense to start coding a killer Game Engine or a Physics engine as your first attempt.

1. For a list of free game engines along with their reviews look here

2. As far as 3D modelling tools are considered, if you have big bucks you can go for the professional tool 3ds max or Maya. A free 3d modeller is Blender and has the features which match the professional ones (though its a bit tough to learn it).

3. Level editors are also aplenty out there but sadly they require you to pay for using it. A free one is Deled

4. Good sound libraries are:
Fmod: http://www.fmod.org
OpenAL: www.openal.org

5. Network API's
RakNet: http://www.rakkarsoft.com
Zoidcom: http://www.zoidcom.com

6. Physics Libraries:
Newton Game Dynamics: http://www.newtondynamics.com
Novodex: http://www.novodex.com
ODE: http://ode.org
Tokamak: http://www.tokamakphysics.com

As far as my experience and persoanl …