c - Multiple string concatenation -
this question has answer here:
- how concatenate const/literal strings in c? 17 answers
i'm new c language , loadrunner.
how do string concatenation in c.
pseudo code:
string second = "sec"; string fouth = "four"; system.out.println("first string" + second +"third" + fouth);
if sure target string can accommodate, can use snprintf
,
#define size 1024 char target[ size ]; // .. .. snprintf( target, sizeof( target ), "%s%s%s", str1, str2, str3 );
for case,
snprintf( target, sizeof( target ), "%s%s%s%s", "first string", second, "third", fourth );
of course, second
, fourth
should valid string (character array).
Comments
Post a Comment