Lawrence Technological University
College of Arts and Science
Department of Mathematics and Computer Sciences

Introduction to C, MCS 1142

Syllabus | Handouts | Assignments | Lecture Notes

A template

The following is a template that you can use as a starting place for all your class programs. Copy the program below to the Windows clipboard. Then open Notepad and paste the program there. Personalize your template by substituting your actual name and student id. Use Ctrl-A or Edit | Select All to highlight the entire template. Now Ctrl-C or Edit | Copy will put your personalized template on the Clipboard.

Now using C++Builder 5, there are a few more steps:

  1. Start C++Builder 5.
  2. Use File | Close All to clear the screen.
  3. Close the "Object Inspector window".
  4. Use File | New... and then double click the "Console Wizard"
  5. In the Console Wizard window, check C for the source type, check console application and uncheck use VCL and uncheck multi threaded.
  6. Click Ok to close the Wizard window and open your new application.
  7. Close the Classes window pane on the left of the Code Editor Window.
  8. Select the Code Editor Window and use Ctrl-A to highlight all the code in Unit1.c. Then use Ctrl-V to replace all the code there with your personalized template.
  9. Use File | Save Project As to save your new template project. Save Unit1.c as c:\mcs1142\mcs1142.c (or m:\mcs1142.c or a:\mcs1142.c if you are using a computer in the S115 lab). And save Project1.bpr as c:\mcs1142\mcs1142.bpr (or m:\mcs1142.bpr or a:\mcs1142.bpr if you are using a computer in the S115 lab).
  10. Finally click the green "Run" arrow to test your template.
  11. Close C++ Builder 5.
/* mcs1142.c
   purpose: a template for programs for mcs1142, Intro to C
   author: Your Name
   student id: YN000000000
   date: ?/?/03
*/

#include <stdio.h>

int main()
{
   /* your variables go here */
   /* your program starts here */
   /* your program ends here */
   /* a patch to hold the output window open when using the
      C++Builder5 IDE, NOT needed for the command line */
     printf("\npress Enter to continue ..."); // tell the user what to do
     fflush(stdin);  // discard any left over keystrokes
     getchar(); // hold the output window open until Enter is pressed
   /* end of hold open patch */
   return 0;
}

Revised January 5, 2003