34 lines
497 B
C++
34 lines
497 B
C++
|
|
#include <iostream>
|
||
|
|
#include <string>
|
||
|
|
|
||
|
|
class Broken {
|
||
|
|
public:
|
||
|
|
Broken(int x) : x_(x) {}
|
||
|
|
|
||
|
|
void show() {
|
||
|
|
std::cout << x_ << std::endl;
|
||
|
|
|
||
|
|
int missing_semicolon()
|
||
|
|
return x_;
|
||
|
|
}
|
||
|
|
|
||
|
|
private:
|
||
|
|
int x_
|
||
|
|
};
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
Broken b(42);
|
||
|
|
b.show()
|
||
|
|
|
||
|
|
char *s = "unclosed string;
|
||
|
|
std::cout << s << std::endl;
|
||
|
|
|
||
|
|
if (b.x_ > 0 {
|
||
|
|
std::cout << "positive" << std::endl;
|
||
|
|
}
|
||
|
|
|
||
|
|
std::vector<int> v = {1, 2, 3};
|
||
|
|
std::cout << v[5] << std::endl;
|
||
|
|
|
||
|
|
return 0;
|