C++
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
- voluntas
- @ignis_fatuus
- ブン
- @Linda_pp
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- takezoh
- まろ
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- I (@wx257osn2)
- イズカワタカノブ
- @tyottyoworks
- ___shanon
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
- むてら
- ガチKGB
x
29
1
2
using namespace std;
3
4
int count = 0;
5
6
string passorFail(int x, int y)
7
{
8
9
if (x > y)
10
{
11
return "pass";
12
count++;
13
}
14
else
15
{
16
return "fail";
17
}
18
}
19
20
int main()
21
{
22
23
int x = 10;
24
int y = 5;
25
26
passorFail(x, y);
27
std::cout << "Count: " << count << std::endl;
28
}
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-10.1.0/include -std=gnu++2a
Start
prog.cc: In function 'std::string passorFail(int, int)': prog.cc:12:9: error: reference to 'count' is ambiguous 12 | count++; | ^~~~~ In file included from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/string:52, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/locale_classes.h:40, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/ios_base.h:41, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ios:42, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ostream:38, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iostream:39, from prog.cc:1: /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/stl_algo.h:4077:5: note: candidates are: 'template<class _IIter, class _Tp> constexpr typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4077 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ prog.cc:4:5: note: 'int count' 4 | int count = 0; | ^~~~~ prog.cc: In function 'int main()': prog.cc:27:31: error: reference to 'count' is ambiguous 27 | std::cout << "Count: " << count << std::endl; | ^~~~~ In file included from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/string:52, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/locale_classes.h:40, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/ios_base.h:41, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ios:42, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/ostream:38, from /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/iostream:39, from prog.cc:1: /opt/wandbox/gcc-10.1.0/include/c++/10.1.0/bits/stl_algo.h:4077:5: note: candidates are: 'template<class _IIter, class _Tp> constexpr typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)' 4077 | count(_InputIterator __first, _InputIterator __last, const _Tp& __value) | ^~~~~ prog.cc:4:5: note: 'int count' 4 | int count = 0; | ^~~~~
1
Finish