Nie moge zmienic wartosci zmiennej?

0

[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

http://prntscr.com/v7dkq

Wiec co jest nie tak?

3

== to operator porównania, = to operator przypisania.

0
Patryk27 napisał(a):

== to operator porównania, = to operator przypisania.

O lol, to ja pare godzin szukalem bledu a on siedzial tam. Ze tez go nie zauwazylem xD

1 użytkowników online, w tym zalogowanych: 0, gości: 1