Visual Studio C++ を使用しています。ダブルとロングロングを切り替えられるようにしたいです。次のプログラムで #ifdef を使用するにはどうすればよいですか? 複数のprintfの場合を処理するために、より単純なソリューションを使用したいと思います。
//#define TYPE_SWITCH
#ifdef TYPE_SWITCH
typedef double myType;
#else
typedef long long myType;
#end
.
.
.
int main()
{
myType a;
#ifdef TYPE_SWITCH
printf ("my value is %lf",a); // I have many printf or scanf and I want to use a simple macro here
#else
printf ("your value is %l",a/10); // I have many printf or scanf and I want to use a simple macro here
#endif
}