coutを使おうとすると、欲しい文ではなく乱数が出力されます。コンパイラエラーはなく、プログラムは正常に動作します。
これが私のコードです:
//question.h
#ifndef _QUESTION_H_
#define _QUESTION_H_
using namespace std;
int first()
{
cout<<"question \n";
return 0;
}
#endif
//main.cpp
#include <iostream>
#include "question.h"
using namespace std;
void main(){
cout<<""<<first<<""<<endl;
cin.ignore();
cin.get();
}
私は自分のヘッダーファイルを書くのはかなり新しいので、それで何か間違ったことをしたのか、それともVisualStudioに問題があるのかわかりません。