I'm having some trouble doing something like this:
I get an error saying "cannot add two pointers", how would I do this?Code:char first[10]; char second[10]; char third[10]; char final[30]; final = first + second + third;
I'm having some trouble doing something like this:
I get an error saying "cannot add two pointers", how would I do this?Code:char first[10]; char second[10]; char third[10]; char final[30]; final = first + second + third;
That is correct, first, second, third and final are pointers. You could use standard C functions for this. For adding strings you can use the function strcat(). Or you could try the C++ type string.
As Shiro said:
Code:string first,second,third; // ... string final(first+second+third);
Since this is C++ you should avoid using low level C strings whenever possible and play with the much better string class. That way you don't have to fool around with functions like strcmp and strcpy. :-)
*Cela*