123456789101112131415161718192021222324252627282930
#include <iostream> #include <string> using namespace std; class safe { public: string giveCode() { return code1; } private: int code1; code1 = 1337; } int main() { int x; Combo: cout << "Please imput combination"; cin>>x; if (x == 1234) cout << giveCode(); else cout << "Wrong combination"; goto Combo; }
ISO C++ forbids declaration of `code1' with no type ISO C++ forbids initialization of member `code1'
safe() {code1 = 1337;}