concatenate (solved)

totaly noob here.

how do I do something as simple as concatenate 2 variables' value:

int val1=1;
int val2=2;
int val3 = operation that will give this variable the value 1 followed by 2 (12) and not the sum.

to check the results I'm doing a Serial.Print(val3).

what am I missing?

tks in advance

1 * 10 + 2 = 12.

I'll leave it to you to figure out how to implement that equation in code.

totaly noob here

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294835596/0#0

Please don't cross-post.

what pauls is saying is
val1*10+val2=val3
int val1=1;
int val2=2;
int val3 = operation that will give this variable the value 1 followed by 2 (12) and not the sum.

How do I do it if the variables content is a string?

How do I do it if the variables content is a string?

figured it out:

String val1 = "Hi! ";
String val2 = "Sup?";
String val3 = val1 + val2;

Serial.println(val3);

my problem is that I'm not used to define the type of variables content.

tks

build and array of char(string) long as the first+seconds strings+1, copy the strings (with string's class method or a loop) and finally add the final character '\0' (this means "end of string" for all the functions in the String.h, and also for printf, scanf, ecc...)