[code]
bool contains(const char* temp){
unsigned short paramLength = 0;
unsigned short textLength = 0;
bool bContains = false;
unsigned short loc1 = 0;
while(paramLength<500){
if(temp[paramLength] != NULL){
paramLength++;
} else{
break;
}
}
while(textLength<500){
if(nString[textLength] != NULL){
textLength++;
} else{
break;
}
}
for(unsigned short i = 0;i<textLength;i++){
if(loc1==paramLength){
break;
}
if(nString[i] == temp[loc1]){
for(unsigned short b = i;b<textLength;b++){
if(loc1==paramLength){
break;
}
if(nString[b] == temp[loc1]){
bContains==true;
cout<<"bContains: "<<bContains<<endl;
loc1++;
}else{
loc1=0;
break;
}
}
}
}
return bContains;
}
[/code]
Za kazdym razem po bContains==true cout zwraca 0(false) i inne funckje uzywajace tej funkcji nie dzialaja bo x.contains("random text") zwraca false
Wiec co jest nie tak?