String append: Difference between revisions

Line 41:
</pre>
 
=={{header|BASICC}}==
<lang C>#include<stdio.h>
==={{header|Applesoft BASIC}}===
//append a string
<lang BASIC>S$ = "Hello"
#include<string.h>
S$ = S$ + " World!"
 
PRINT S$</lang>
int main()
==={{header|BBC BASIC}}===
{
<lang BBC BASIC> S$="Hello"
char S$+str[]="Good World!Morning";
char *cstr=" PRINTto S$all";
char *cstr2=" END</lang>!!!";
int x=0;
//run time failure when space allocated to str is insufficient.
/* 1st method*/
strcat(str,cstr);
 
/*2nd method*/
x=strlen(str);
sprintf(&str[x],"%s",cstr2);
 
printf("%s\n",str);
return 0;
}
PRINT S$</lang>
{{out}}
<pre>HelloGood WorldMorning to all !!!</pre>
 
=={{header|C++}}==