Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Viewed less than a minute ago

vgvxPo2qkvdlDsnK

C++ gcc 13.2.0

Created at 19 minutes ago

Created by anonymous

Author

anonymous

19 minutes ago

Language

C++

Compiler

gcc 13.2.0

Options
Warnings
Don't Use Boost
C++03
-pedantic-errors

Author

anonymous

19 minutes ago

›
⌄
⌄
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>

#ifdef IS_2ND_STAGE

int main() {
test(); // 関数の呼び出し
return 0;
}

#else

void test() { // 関数の宣言 (兼定義)
std::cout << "hello from test()!\n";
}

#define IS_2ND_STAGE
#include __FILE__

#endif

$ g++ prog.cc -Wall -Wextra -std=c++98 -pedantic-errors
hello from test()!
Exit Code:
0