Lecture022 Some basics - The Programming Process errors...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 3 -- 1 Computer Science I - Martin Hardwick The Programming Process Use an editor to create a program file (source file). contains the text of the  program Use a compiler to convert the source file into a machine code file (object file). convert from “English” to  binary with machine  operations Use a linker to convert the object file into an executable file. include other machine code  that the program requires In Visual C++ make sure  you create an “empty”  project or you will get  linker errors Run the executable file. Editor Program.cpp Compiler Program.obj Libraries Linker Program.exe Run the Program Done success errors errors errors
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 3 -- 2 Computer Science I - Martin Hardwick The First C++ Program // Hello World Program // Author: Martin Hardwick #include <iostream> using namespace std; int main () { cout << “Hello World!”  << endl; return 0; } Anything following // is a comment intended to improve the readability of the program. #include is used to tell the compiler and linker what library resources the program uses. the <iostream> resource  defines everything you  need to display messages  on the screen The line “using namespace std;” says you want to use standard c++ names for things This program contains one function named “main”.
Background image of page 2
Lecture 3 -- 3 Computer Science I - Martin Hardwick Defining A C++ Function A C++ function has the following form: The name of this function is “main”. The word “int”, means that this functions returns an integer number. usually 0 to indicate that the program ran correctly.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/30/2012 for the course CSCI 101 taught by Professor Hardwick during the Fall '08 term at Rensselaer Polytechnic Institute.

Page1 / 11

Lecture022 Some basics - The Programming Process errors...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online