Lost in incompatible types in assignment?

How do you add chars together (concatenation)?

...
long randNumber;
char randWav[5] = {".wav"};
char randWav1[8];

 randNumber = random(100, 400);
 randWav1 = randNumber + randWav;
 Serial.println(randWav1);
....

I get "incompatible types in assignment of 'char*' to 'char [8]'" on the randWaz1 = randNumber + randWav; line. What dumb newbie things am I doing or missing?

You could try strcat, or sprintf

Bucky99:
How do you add chars together (concatenation)?

sprintf() is probably your friend here, as AWOL mentioned. Try doing it this way:

...
long randNumber;
char randWav1[10];

 randNumber = random(100, 400);

 sprintf(randWave, "%ld.wav", randNumber);

 Serial.println(randWav1);
....

Incidentally, randNumber needn't be long. A regular int should do.

edit: fixed typo m-->,

//strcpy(randWav,randNumber);
//
//sprintf(randWav,randNumber);

These give me - invalid conversion from 'long int' to 'const char*'

What does %ld do? And where can I learn about it and the strcpy/sprintf functions?

Google's a useful starting point.

Here's a sprintf tutorial, hope it helps.

Thank you for the replies and the resources.