It might be a silly question but I have to ask it.
It is about dat files one friend of mine said to me that dat files are normal exe files but the ending was changed.
When this isn't true how can I creat dat files and how i link them to my game (like normal exe files with spawnl(bla,dsd.exe,bla))
There is no specific layout of a dat file, it can be whatever you want. A text file, a bitmap or pure binary data suited for your datatypes. You choose.
It's the way you handle the data that counts.
To creat a binary datafile, if that's what you want:
//What ever you want...
f.write((char *)(lj+a),sizeof(struct hello));
And to read the same datafile:
cout<<"The file does not exist!";
f.read((char *)(j+count),sizeof(struct hello));
Well your friend was partially right, if i compiled whatever.exe and renamed it to whatever.dat, i believe it would still run.