I'm new to programming, I've been working on a small text-based rpg, I closed Code::Blocks, I remember it asking me something about "The default has changed, save changes?" I restarted my laptop for an irrelevant reason, when I opened up the project again and went to add a file, the cpp/h files were gone and the only cpp file was "main.cpp" and all it had was the Hello World cpp file, project.depend project.layout, project.cbp, obj, and bin. Also, the project files (the 3 cpp and header file that made the project up) reappeared in the "devprjs" folder, not a road block or anything but I'm curious why this happened?
You did not save the project. Which means you're lucky, because contrary to the appearance, your work is not "gone".
The "project" is the meta-information which tells Code::Blocks what to do, for example: compile these 3 files into one program. It is saved in the
.cbp file.
However, in your case, it appears that you've generated a new project using the wizard (which will write the default cookie-cutter project as well as the silly Hello World
main.cpp to disk). Then you did some work, creating those 3 files, and adding them to the project, but you
did not save the project (even when asked). Therefore, the files appear "gone". Just re-add them, and save the project.
And while you're at it, you can delete the
main.cpp file that contains Hello World, you're not going to need it (oh how much I hate this file, every single time for every new project... grr...).