I'm sorry if this is a stupid question... I just started taking a course to learn C++ and don't have any previous experience, so be gentle :) I keep getting this error message (error C2440: '=' : cannot convert from 'std::string' to 'char') to my code pasted below. I've added ** to the two lines the error is referring to... feel free to "treat me like i'm 5" ;)
airline_name is an array of strings. IE, it is 6 separate strings.
Therefore, airline_name[x] is one of those 6 strings.
On the other hand... air_duplicate is not an array, but instead is a single string. Therefore, air_duplicate[x] is pulling out a single character from that one string.
So this line:
air_duplicate[x] = airline_name[x];
Is attempting to assign a full string (airline_name[x]) to a single character (air_duplicate[x]). Obviously you cannot do this, since a single character is not large enough to hold an entire string.
I'm not sure what you're trying to do here, but maybe you meant to make air_duplicate an array rather than a single string?
thank you for explaining to me exactly what my incorrect code was attempting to do! it helped me figure out the solution... i was trying to create a duplicate index to sort my data alphabetically and not only did i have the create dup code in the wrong area, i hadn't declared the index. problem solved and program running correctly with no errors! thank you again for your help and "explaining to be like i'm five" as i requested! ;)