I have the following C++ code in a subdirectory of my project: /storage/app/users/user1/12/12.cpp
#include <bits/stdc++.h>
using namespace std;
main(){
int x,y,z,t;
freopen("input.txt","r",stdin);
cin >> x >> y >> z >> t;
cout << x <<" "<< y <<" "<<z <<" "<<t;
}
This code is then compiled into a .exe file: /storage/app/users/user1/12/12.cpp.exe.
The input.txt file is in the same directory with the 2 given files and contains
1 2 3 4
When I tried to run 'cd storage/app/users/user1/12 ; ./12.cpp.exe', it produced the expected output: 1 2 3 4
But when I tried to run it directly: './storage/app/users/user1/12/12.cpp.exe', it produced such a strange output: 0 4254553 0 1
Why is it happening?