As from discussed came to know the problem is relative path.
fstream support relative paths as below..
Consider the following case where your input file is one level up than exe file.
E:\MyProgramBin\YourExe.exe
E:\YourInputFile.ppm
In this case, you can create your filename as below.
filename1 = "..\YourInputFile.ppm"
and use that filename1
in ifstream
std::ifstream src(filename1, std::ios_base::binary);