Code::Blocks .c extension issue

Hello.

I was recently testing out the "hello world" program in Code::Blocks using C. When setting the project up I chose C as the language, yet the file extension remained as .cbp. I manually changed this to .c and the program seemed to run fine.

However, when I closed the program and opened it back up again, it looked like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
	<FileVersion major="1" minor="6" />
	<Project>
		<Option title="hello_world" />
		<Option pch_mode="2" />
		<Option compiler="gcc" />
		<Build>
			<Target title="Debug">
				<Option output="bin/Debug/hello_world" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Debug/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-g" />
				</Compiler>
			</Target>
			<Target title="Release">
				<Option output="bin/Release/hello_world" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Release/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-O2" />
				</Compiler>
				<Linker>
					<Add option="-s" />
				</Linker>
			</Target>
		</Build>
		<Compiler>
			<Add option="-Wall" />
		</Compiler>
		<Unit filename="main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Extensions>
			<code_completion />
			<envvars />
			<debugger />
			<lib_finder disable_auto="1" />
		</Extensions>
	</Project>
</CodeBlocks_project_file>

I have no idea why the code looks like this. I am trying to use Code::Blocks to write C code for University as it is the IDE that I am most comfortable using. If anyone could show me how to set everything up to be able to write C code I would be very grateful.
The .cbp file should not be renamed. It is, as indicated from the sample above, the CodeBlocks Project File. It is used by the IDE to keep track of the details of your project.

If you go ahead and create a project, choose "C" as the language and accept the default extension, you should find there is a separate file named "main.c" which is automatically created. That is the file where you will enter your own program code.
Thanks Chervil, I see that now.
Topic archived. No new replies allowed.