Create your source code.
The automatic project creation step (above) creates one source code file
called main.c, which contains the code for "Hello world", as we've done
This source code file will be what you pass in to be marked, so you need to
rename it from main.c to <your-user-name>-ass1.c.
This takes three steps. First you rename the file, second you add the file
to your project and third you remove the reference to "main.c" from your
YOU MUST DO THIS FOR EVERY ASSIGNMENT YOU TURN IN.
- Close the project created in the step above
(in CodeWarrior, select File - Close).
Next go out to your desktop and find your mc140 folder.
Inside, there will be a folder called ass1.
Inside the ass1 folder, there will be a file called main.c
(depending on how your folder view is set up, you may not see the ".c"
Click once on main.c and select File - Rename
(from the Windows menu), then type in
For example, I would type in sklarel-ass1.
Now close that folder and go back to your CodeWarrior window.
- Inside CodeWarrior,
select File - Open and select the ass1 project
(the project file is named "ass1.mcp").
The project window pops up, containing three rows:
Source, MSL ANSI Libraries and Win32 SDK Libraries.
Click on Source once, to highlight it.
Now click on Project - Add files.
Add the file <your-user-name>-ass1.
For example, I would add sklarel-ass1.
Click on Add.
Then click on OK to add the file to both
C Console App Debug and
C Console App Release applications.
Now the file has been added to Source.
If you click on the + next to Source, an icon labeled
<your-user-name>-ass1.c should appear.
- Click on the + next to Source, and an icon labeled
main.c will appear.
Click on the main.c icon once, to highlight it.
Select Edit - Delete, then click on OK.
In order to edit your source code, click on the + next to
Double click on the icon labeled <your-user-name>-ass1.c,
and a window will pop up containing a text editor.