Re: Problems with strcat parameters


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]

Posted by Cruinh on July 29, 1999 at 21:40:03:

In Reply to: Re: Problems with strcat parameters posted by Arm on July 29, 1999 at 21:13:28:

: strcat should work like this:

: char target[64] = "First ";
: char source[32] = "Second";
: strcat(target, source);

: target will then contain "First Second". Make sure that your target memory block is large enough to hold the combined string.

: In your example:

: char *output;
: strcat(output, "/");

: your app will core, since output is a dangling pointer... that might be your problem.

: Also note that \ is c/c++ is really typed at "\\"...

: did any of this help?
: -A


ok... then, if I already have object declared as above, how can I assign the string in target to it without the compiler complaining that it cannot convert from 'char (*)[64]' to 'char *'?
do I need to declare output differently?




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]