"" に関する原因と対処

このコンパイルエラーの原因と対処に関して説明します。

スポンサード リンク

Microsoft Visual C++にて以下のソースでコンパイルエラーが発生します:

コンパイルエラーメッセージ:
error C3484: 構文エラー: 戻り値の型の前に '->' が必要です

ソース(バグ有り):

#include <stdio.h>
#include <conio.h>
#include <ctype.h>

int main()
.
int ch;
printf( "Y キーを押すと終了します。" );
do
{
ch = toupper( _getche());
} while( ch != 'Y' );
}


原因:


対処:


ソース(修正済み):

#include <stdio.h>
#include <conio.h>
#include <ctype.h>

int main()
{
int ch;
printf( "Y キーを押すと終了します。" );
do
{
ch = toupper( _getche());
} while( ch != 'Y' );
}

スポンサード リンク



[コンパイルエラーコード、メッセージに戻る]