0

hi its been 2 years since the last time i program in c and this is my first after 2 years. So i'm not that familiar anymore to the syntax in c(especially i'm already programming in java). So my problem is, i don't know if i did something syntactically wrong in my code. But an error occurred and it said that: "invalid operands to binary +" to the line..

valString += tempExpName;

//valString and tempExpName are both of type string. I already included stdlib.h in my code, but it won't removed the error.

--please could someone explain to me what is really wrong? Thanks :)

2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by gerard4143
0

The problem...your trying to add two char pointers...I think.

Could you post the rest of the code.

Edited by gerard4143: n/a

0

The problem...your trying to add two char pointers...I think.

Could you post the rest of the code.

thanks. I realized it after i posted it. I just can't add two char pointers/strings. I have to used the function strcat(str1, str2), right?

0

thanks. I realized it after i posted it. I just can't add two char pointers/strings. I have to used the function strcat(str1, str2), right?

Well if you want to append one string onto another, then yes use strcat.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.