PDA

View Full Version : How to add a space between words?


shaoen01
03-04-2007, 03:02 PM
Hi,

I have 2 strings, test1 and test2. I wish to concat both of them together as one string, but i would like to have a spacing between the values of test1 and test2. However, i cant seem to be able to do it.

Can someone please help me out? Thanks

Rappa
03-04-2007, 03:13 PM
you mean like:

test1 + " " + test2?

shaoen01
03-04-2007, 03:39 PM
Sorry, i forgot to mention that i need to do it in C programming. Anyway, it does not work.

Aradon
03-04-2007, 09:11 PM
Are you doing this in a printf statement or for assignment? I know in the library string.h there is a method called strcat. Here are a couple examples:

http://gd.tuwien.ac.at/languages/c/programming-bbrown/c_104.htm