Number / 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ ./test Central Central Processing Central Processing Unit $
#include <stdio.h> #include <string.h> int main() { char a[8] = "Central"; char b[11] = "Processing"; char c[5] = "Unit"; char x[32] = ""; strcat(x, a); printf("%s\n", x); strcat(x, " "); strcat(x, b); printf("%s\n", x); strcat(x, " "); strcat(x, c); printf("%s\n", x); return 0; }
#include <iostream> #include <sstream> int main() { std::string a,b,c; std::string x; a = "Central"; b = "Processing"; c = "Unit"; x += a; std::cout << x << std::endl; x += " " + b; std::cout << x << std::endl; x += " " + c; std::cout << x << std::endl; return 0; }
class Main { public static void main(String[] args) { final String a = "Central"; final String b = "Processing"; final String c = "Unit"; StringBuffer x = new StringBuffer(); x.append(a); System.out.println(x); x.append(" ").append(b); System.out.println(x); x.append(" ").append(c); System.out.println(x); } }
my $a = "Central"; my $b = "Processing"; my $c = "Unit"; my $x = ""; $x .= $a; print"$x\n"; $x .= " $b"; print"$x\n"; $x .= " $c"; print"$x\n";
a = "Central" b = "Processing" c = "Unit" x = "" x += a puts x x += " " + b puts x x += " " + c puts x
最終更新日 : 2004.08.23
Number / 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
copyright 2000-2005
ARGIUS project