Hi,
I'm passing in a charcater array inCurrency and am wondering how I see if this is equal to a certain value such as pound. I have entered in pound earlier in the program into the array but I suppose it has other characters after the first five letters. Do I need to trim the array or something? Any help gratefully received.
void calculate_data(int amount, char inCurrency[9], char outCurrency[9])
{
if(inCurrency == "pound" )
{
printf("%d, %s, %s", amount, inCurrency, outCurrency);
}
}
I'm passing in a charcater array inCurrency and am wondering how I see if this is equal to a certain value such as pound. I have entered in pound earlier in the program into the array but I suppose it has other characters after the first five letters. Do I need to trim the array or something? Any help gratefully received.
void calculate_data(int amount, char inCurrency[9], char outCurrency[9])
{
if(inCurrency == "pound" )
{
printf("%d, %s, %s", amount, inCurrency, outCurrency);
}
}