Guide to the Miracle C Compiler

Tutorial: Writing, Saving, Compiling, and Running the "Hello World" program

This simple program displays a jaunty line of text. It's a favorite "first day of class" warhorse, presenting the "main" function, comments,and the #include header.

1. Launch Miracle C. 2. Create a source file. You can do this in one of three ways:

  • Click the New File button
  • Pressing Ctrl + N
  • Click File and New

3. Type the following code into the text window:

/*Hellowor.c*/

#include<stdio.h>

void main()
{

printf("Hello, world!");
}

    Notice that the Miracle C text editor colors your code for you:

        • Red: constants, including hard-coded text strings
        • Blue: preprocessor directives, function types, and data types
        • Black: function names and separators
        • Green: comments

4. Save your file. You can do this in one of three ways:

  • Click the Save File button.
  • Press Ctrl + S.
  • Click File and Save .

5. Name your file,preserving the .c filename extension.

*Miracle C will accept only file names of 8 characters or less, not including the .c extension.

 

6. Compile your program. You can do this in one of three ways:

  • Click the Compile button.
  • Press F6.
  • Click Run and Compile.

    *If you have not registered your copy of Miracle C, you will see a reminder message every time you compile and link. Don't forget to register so you can obtain online support and compiler source code!!

After compiling, Miracle C displays an output window showing the results of the compilation. If the compilation was successful, you see something like this:

output screen

If your output window looks like this, close it and proceed.

If your output window shows error messages, see Understanding common error messages.

 

7. Link your program. You can do this in one of three ways:

  • Click the Link button.
  • Press F7.
  • Click Run and Build.

     

After linking, Miracle C displays an output window showing the results of the linking. If the linking was successful, you see something like this:

If your output window looks like this, close it and proceed.

If your output window shows error messages, see Understanding common error messages.

 

8. Run your program. You can do this in one of three ways:

  • Click the Run button.
  • Press F8.
  • Click Run and Execute.

    Then click Run in the Execute Program dialogue box.

Here's what the output of your program should look like:

Hello, World

 

Congratulations! You've just written, compiled, and run your first program with Miracle C!