Again,, I'm just a total beginner and don't even know everything I'm writing down. But I thought this would come close to what I wanted to write.
Here are the problems I get with this code:

1) It only goes for a several amount of tries, which is diffrent everytime. And that sounds like it's good, I mean, if it guessed the number, it should stop. But that's where the problem comes up: It stops, but not on the right number. Just a random one.
2) I know there's nothing of this in the code, but I wanted it to listen to the "Go higher" and "Go lower" lines. How do I do that?

-- Any help is Great help,, Thanks!! --

P.S. I know there's another post about this, But in that post the person writes in a whole diffrent way. And I would like (not selfish ment) to write it down this way. Thanks!

If you want to make the computer guess your number (it's really a fraud game since your computer knows your number but to practice with it let's proceed) you can make it insert a number greater or lesser than its previous guess:

As Moschops said, you don't want to recalculate iCompNum at the end of your loop, this will change the number when you exit. Instead, delete line 42 and calculate it at the start of the loop.

As for lines 30 and 35, this is where you want to redefine the limits of your random number. So don't calculate iCompNum, just calculate the limits. A good way to create limits for a random number is by doing: MyRandomNumber = rand() % (UpperLim - LowerLim) + LowerLim.

Thanks guys!
I've noticed that I'd put unnecessary lines into my code, thanks for letting me know. (:
And after I've followed all the comments, I got the right thing, But when the computer gets to the number in front of my number, the program crashes.
It's like this: