17
C Pre-Course Workshop Terence Lee [email protected] QT406 -> PQ607 http://www.comp.polyu.edu.hk/ cws2004 http://www4.comp.polyu.edu.hk/ ~csterence/cpcw/

C Pre-Course Workshop Terence Lee [email protected] QT406 -> PQ607 csterence/cpcw

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

C Pre-Course Workshop

Terence Lee

[email protected]

QT406 -> PQ607

http://www.comp.polyu.edu.hk/cws2004

http://www4.comp.polyu.edu.hk/~csterence/cpcw/

Login Novell

• Do not click “Workstation only”• Show “Advanced Menu”

– Click “Advanced” Button if not showing up• Change context

– Click “Context” button– Expand COMP – STUDENT – USER– Select “SC”– Click “OK”

• Key in Username / Password– Username : cwsXXX (where XXX will be assigned individually)– Password : cp2004pre

• Click “OK” button to login

Work Space Environment

• Your own server disk space is in J:

• This work space will be used for whole workshop

• Your own files in local hard disk will be deleted after re-boot

• All files and directory will be deleted after the workshop

Development Environment

• Start Menu

–Programs

•Microsoft Visual Studio.Net

–Microsoft Visual Studio.Net

Open a New Project (1)• Click “New

Project” button

• Or “File” – “New” – “Project”

Open a New Project (2)• Select Visual C++ Project• Choose Win32 Project• Enter Name (MyProject)• Change the location to J:\• click “OK” button

Open a New Project (3)• Click

“Application Settings”

• Change to “Console Application”

• Check “Empty Project”

• Click “Finish”

Create Your Program (1)In Solution Explorer on Right Hand Side

•Right click “Source Files”•Choose “Add” - “Add New Items”

Create Your Program (2)•Choose “C++ Files (.cpp)”•Enter Name•Keep Location unchanged•Click “Open”

Create Your Program (3)Enter your program and Save it.

Note the quotation marks!

Try Your ProgramSelect “Debug” – “Start without Debugging

If prompt, click “Yes” to build the Project

ResultPress any key to returnTo the Editor

Build Your Project•Choose “Build”•Select “Build MyProject”

Execute Your Program (1)• Open a Command Prompt

Execute Your Program (2)•Type “J:” to change to drive J:

•Type “cd MyProject” to changed to your project directory

•Type “cd debug” to change to your program debug directory

•Type “dir” to display what files are created (Most Important one is “MyProject.exe”)

•Type “MyProject” to execute your program

NoteAfter modifying your program, Windows may prompt you your Program has been modified. Just click “Yes” or “Yes to All”To reload the changed program

After certain compilation errors And program modifications, It is suggested to Clean the ProjectBefore the next compilation/build.

Turbo C Compiler

http://www.pitt.edu/~stephenp/misc/turboC.exe