User forums > Using Code::Blocks
File Save
(1/1)
Alienspecimen:
Go ahead, laugh all you want...:)
Through searching this website, I found out that the error I am getting "#iostream file not found" upon typing in my first program is caused by me saving the file in the wrong format. Unfortunately, I dont see a way to save it in the right format.
I open a new project which is supposed to be a C++ console application. I do see the "Main.cpp" which contains "Hello world" code, but instead of using it, I open up a new file. The program asks me if this is a C/C++ file and I click "yes" upon which, the file is saved as "whatever_name_I_choose.c"
Why would CB save files with a .c extention in C++ projects? How do I change the extension of the file from .c to .cpp?
Thanks in advance.
B.
Jenna:
"File -> Save as" or, when the file is closed, right click the file in the projects tree and chose "Rename" .
Alienspecimen:
Thank you for your reply, Jens.
I missed the part that the file needs to be closed at first.
It also looks like I was saving a new empty file, but still dont understand why it saves as a .c file within a C++ project. Can anyone, please explain?
Thanks
Best
B.
P.S. New->File->C/C++Source saves as .cpp automatically.
Navigation
[0] Message Index
Go to full version