Presentation is loading. Please wait.

Presentation is loading. Please wait.

N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?

Similar presentations


Presentation on theme: "N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?"— Presentation transcript:

1 n from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data? n what’s natural language, high-level language, machine language n what’s compiler, linker, library? n what’s source/object/executable code? Computer Terms Review

2 The Fundamentals of C++ First programs Development Environment

3 l Program structure l First programs n hello, world n calculating the area of a rectangle l Eclipse l Subversion Program Organization

4 l Program written in human-readable from is called source program - extension -.cpp (helloworld.cpp) l compiler is applied to the source program to translate it into form machine understands - we use g++ (GNU C++ compiler) l compiler may produce either object code - direct translation of the source program - extension o. (helloworld.o) l compiler (actually linker) adds all other necessary parts for the program to run on a computer and produces executable code (a.out or any name you like) l specially produced executables can be traced (more on that later) Programming Cycle

5 // Program: Display greetings // Author: Wayne Cheng // Date: 6/01/2011 #include using namespace std; int main() { cout << "Hello,world!" << endl; } A First Program - Greeting.cpp preprocessor directive output statement comments function named main indicates start of program name collision protection

6 variable declarations input output #include int main() { // Extract length and width cout << "Rectangle dimensions "; int length; int width; cin >> length >> width; // Compute and insert the area int area; area = length * width; cout << ”Area = " << area << " = length " << Length << " * Width " << width << endl; } computation

7 l Eclipse is an integrated development environment (IDE) for writing, debugging, testing and running programs l C/C++ development toolkit (CDT) is used to develop C++ programs in Eclipse. l Eclipse basic concepts n workbench - is a collection of panels (called views) for programming tasks. CDT provides a C/C++ workbench. n view - is a panel dedicated to a specific task. ex: editor view to edit source files, console view to display compiler or program outputs n perspective - a set of specially arranged views for the particular tasks. Two most important perspectives in CDT are C/C++ and debug. n project - a set of files that are developed jointly. A project compiles into a single executable. A Project Explorer view lists all the projects in the workbench n toolchain - a compiler and other supporting tools that compile the source program into executable and help debug it. We use g++ which is part of Gnu Compiler Collection (GCC) toolchain Eclipse

8 l subversion – version control software used by programmers for team code development. We use for lab submission and grading n has centralized code repository n C++ projects can be: added to repository, checked out and committed n repository is accessible from the web  method to verify submission l Subclipse is an extension of Eclipse that allows it to interact with Subversion. It comes with its own Team Synchronization perspective. However, most of the functionality is accessble from the standard C/C++ CDT perspective. Subversion


Download ppt "N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?"

Similar presentations


Ads by Google