Its a game of life. Loads everything from inp.in.
Tough after the first step everything dies. Any ideas? Please explain if you have something, don't just do my work.
Here is what inp.in contains:
1 1 0 1 1
1 1 0 1 0
0 0 1 0 0
0 0 0 0 0
It was quite easy for me to spot because the compiler told me.
My compiler wrote:
test.cpp:36:5: warning: no return statement in function returning non-void [-Wreturn-type]
Most compilers are able to warn you about simple mistakes like this. If you're using GCC/MinGW/Clang I strongly recommend compiling the code with at least the -Wall compiler flag.
Though it is only a warning, it should be considered an error in most circumstances.
Here for example, if the call to function two() is uncommented, it will probably cause a program error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream>
#include <string>
usingnamespace std;
int one() { }
string two() { }
int main()
{
cout << one() << '\n';
// cout << two() << '\n'; this line probably cause a crash
cout << "Done\n";
}