Language
C++
Compiler
gcc 12.1.0
Options
Warnings
Don't Use Boost
C++11
-pedantic
Raw compiler options
-Dsome=
-Dcondition=int i=0; i<1; i++
-DPhone1=phone1
#include"phone.h"
#include<iostream>
using namespace std;
int main (){
for(some condition){
phone Phone1;
if(phone1.isOn()){
phone1.doSomething();
}
else{
phone1.doSomethingElse();
}
}
}
class phone {
public:
bool isOn() { return true; }
void doSomething() {}
void doSomethingElse() {}
};
$ g++ prog.cc -Wall -Wextra -std=c++11 -pedantic -Dsome= -Dcondition=int i=0; i<1; i++ -DPhone1=phone1
Exit Code:
0