Skip to content

Instantly share code, notes, and snippets.

@ufcpp
Created February 8, 2015 11:34
Show Gist options
  • Save ufcpp/ff56796ebd149c2030cf to your computer and use it in GitHub Desktop.
Save ufcpp/ff56796ebd149c2030cf to your computer and use it in GitHub Desktop.
variable initialization in C++
struct X
{
X() {}
};
void main()
{
X x(); // X 型の変数 x に対して、コンストラクター X() で初期化
}
@melpon
Copy link

melpon commented Feb 8, 2015

× // X 型の変数 x に対して、コンストラクター X() で初期化
// 引数を取らず、X 型を返す関数 x の宣言

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment