why does this work?

first i create an empty (doesnt have to be empty) char
then i overwrite it with a string which can have any length (hax!?)
fopen() accepts it as legit filename

i accidently compiled that and it works perfectly fine
but why??

1
2
3
4
5
6
char filename[]=""; 
stringstream stream;
stream <<"werte//E="<< E <<"_F="<<F<<".txt";
stream >> filename;
FILE*pFile;
pFile=fopen(filename, "w");
Last edited on
Please, do not doublepost. See http://www.cplusplus.com/forum/general/163420/
Topic archived. No new replies allowed.