0

Hey guys,

This is my first post here :)

I have to compare to strings and then continue on with the loop..

void HighScore::removePlayer(const string& name)
    {
        int i,j = 0;

cout<<"Attempting to remove  " << name<<endl;
        while (i<d_nPlayers)
        {
              
         if (d_players[i].name==name)
        {
             cout<<"Found :  " << name<< "at slot: " << i <<endl;
// I never reach this loop
...

I did a quick search on this forum and tried using the strcmp() included in <string.h> but that didn't work either. I got error message "no function call to .... "

I'm guessing it's because one of my strings is a constant string instead of a CHAR? I don't know...

Any help is appreciated.

Lol... I found my problem after reading the code on this forum! "int i , j = 0" ooops.

Anyway..is there a reason why I can't use strcmp ? Just for future reference...

Edited by PoRco1x: n/a

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by PoRco1x
0

d_players is an array of structures

structure contains

name : string
score : long

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.