CソースとC++ソース共存実験(その1)CソースとC++ソースの共存を実験してみた。
とは言っても、printf()とcout<< を同時に使ってみただけ。

同時に使えるんですね。まずは、第一歩。


$ cat c_cpp_test.cpp
#include
#include
using namespace std;

int main()
{
printf(“Hello, world\n”);
cout << "Hello, world2\n";

return 0;
}
$ g++ c_cpp_test.cpp
$ ./a.out
Hello, world
Hello, world2
$

続きがあるのか?は未定w


関連記事:

Facebook Comments

 Leave a Reply


上の画像の文字を入力して下さい(入力必須)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <img localsrc="" alt="">