I've opened a .cpp file with C::B without inserting it in a project and when I tried to compile it, I got "fstream.h : no such file or directory". Am I missing something? Thank you in advance.
Yes, a modern book to teach you modern c++ :)
The header fstream.h is part of C++ from long, long ago before the language was standardised (which happened in 1998). You should not be using it in your code, and you should not be using learning resources that suggest you do use it. The header file you want is fstream, used as:
#include <fstream>
I am bound to use it in my code. I'm participating in an olympiad, and I am only allowed to use this particular header, or maybe stdio in my code.
Well, it is an "olympiad" run by clueless, know-nothing chumps then. That header is not part of C++.
And this is off-topic. The problem you are having has nothing to do wiith Code::Blocks.
fstream.h and fstream are (should be) the same header. Write fstream.h yourself:
#pragma once
#ifdef __CPLUSPLUS
#include <fstream>
#else
#error "only for C++"
#endif
Most of compilers do something like this but in opposite fashion :) They have "traditional" headers (like fstream.h) for backward compatibility and redirect "new style" headers (like fstream) to them. You have only a "new style" header and redirect the "traditional" header to it. Everybody who will compile your program and who will have fstream.h should pass.