Dear all;

I want to join three strings become one string. For example

char date1 = "03";
char date2 = "06";
char date3 = "2007";
char new string;

what I need is new string like:

new string =03-06-2007.txt

I will use new string as input file name that will be automatically opened by main program.

thanks very much for your best help.

cheers
marzuki

>char date1 = "03";
>char date2 = "06";
>char date3 = "2007";
>char new string;
None of these are strings in C. Your syntax is way off.

>what I need is new string like:
>new string =03-06-2007.txt
Look up sprintf. You can also use strcat if you want a more manual solution, but sprintf is better suited to producing formatted output and storing it in a string.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.