c++ - how do you change arrays? -


help! im trying replace 'a' , 'e' ' ' in array keeps replacing of array instead.

    for(int x = 0; x < array_length); x++)     {        if(city_name[x] == 'a' || 'e')         city_name[x] = " ";     } 

if(city_name[x] == 'a' || 'e') 

should be

if(city_name[x] == 'a' || city_name[x] == 'e') 

your code equivalent to

if( ( city_name[x] == 'a' ) || 'e') 

which city_name[x] == 'a' , checks result of statement || 'e'


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -