A
alternativa
Hello,
I'm dealing with a problem concerning strcat.. I would like to
concatenate 3 strings, which in fact are integer numbers.
My idea is to write something like this:
void main (void);
{
long year; /*they must be of a long type because of */
long month; /*some other reasons*/
long day;
char *str1;
char *str2;
/*here I have functions asking for the data - year, month, day*/
str1 = strcat (year,month);
str2 = strcat (str1,day);
}
So for input:
2005
01
07
I'd like to get: 20050107.
Do you think it would be possible to obtain 2005-01-07? I guess I'd
need to concanate also the year with '-', then 'year-' with 'month',
and the same with day, so I get 'year-month-day'.
thanks,
a.
I'm dealing with a problem concerning strcat.. I would like to
concatenate 3 strings, which in fact are integer numbers.
My idea is to write something like this:
void main (void);
{
long year; /*they must be of a long type because of */
long month; /*some other reasons*/
long day;
char *str1;
char *str2;
/*here I have functions asking for the data - year, month, day*/
str1 = strcat (year,month);
str2 = strcat (str1,day);
}
So for input:
2005
01
07
I'd like to get: 20050107.
Do you think it would be possible to obtain 2005-01-07? I guess I'd
need to concanate also the year with '-', then 'year-' with 'month',
and the same with day, so I get 'year-month-day'.
thanks,
a.