Last active
October 4, 2015 00:17
-
-
Save segfo/2fc52be91d35ed41756a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include<string.h> | |
using namespace std; | |
int main() | |
{ | |
// これはあくまでも一例、C++ではString型を使うこと。 | |
// Cの書き方とC++の書き方を混ぜるのはあまり良くない。 | |
int v = 12; // プログラム的に変わる変数v(variable) | |
char *hoge = new char[v]; // 動的配列の生成 | |
strncpy(hoge,"hello world",11); | |
cout << hoge << endl; | |
delete [] hoge; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment