Presentation is loading. Please wait.

Presentation is loading. Please wait.

C++ Introduction : C++ compilation. Visual Studio 2008 : Creating Command-Line Program.

Similar presentations


Presentation on theme: "C++ Introduction : C++ compilation. Visual Studio 2008 : Creating Command-Line Program."— Presentation transcript:

1 C++ Introduction : C++ compilation

2 Visual Studio 2008 : Creating Command-Line Program

3 Visual Studio 2008 Creating Command-Line Program

4

5

6

7 C++ Introduction : C++ program structure

8 It is OK to use C code in C++ program

9 C++ Introduction : C++ Standard Input/Output

10 Standard Output (cout) cout : screen stream object

11 Standard Input (cin) cin : keyboard stream object

12 C++ Introduction : Functions

13 C++ Introduction : array/pointer/dynamic allocation Array/Pointer : almost same as C Dynamic allocation –malloc (in C)  new (in C++) –free (in C)  delete (in C++) Ex) in C int *x; x=(int*)malloc(10*sizeof(int)); … free(x); Ex) in C++ int *x; x=new int[10]; … delete[] x;

14 C++ Introduction : C++ class

15 class class : data structure type that can contain member data and member functions.

16 class constructor/destructor –member function that is automatically called when the object is created/deleted.

17 pointers to class object

18 C++ Introduction : Input/Output with Files

19 file stream class –ofstream: stream class to write on files –ifstream: stream class to read from files –fstream: stream class to reaad and write from/to files

20 File open mode


Download ppt "C++ Introduction : C++ compilation. Visual Studio 2008 : Creating Command-Line Program."

Similar presentations


Ads by Google