• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
C++ programming
 

C++ programming

on

  • 980 views

 

Statistics

Views

Total Views
980
Views on SlideShare
967
Embed Views
13

Actions

Likes
1
Downloads
42
Comments
0

2 Embeds 13

http://www.linkedin.com 8
http://www.slideshare.net 5

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    C++ programming C++ programming Presentation Transcript

    • C/C++
      • By
      • Abdallah Abuouf
      • 3 rd IT
      • [email_address]
    • Agenda
      • Why c++
      • Basics
      • Pointer
      • Oop
      • Data structure
      • C/C++ under Linux
      • Create GUI by GTK+
      • C++ and netbeans
    • Why C++ ?!!
      • Pointer -> The power
      • Oop -> Ease of understanding and clarity
      • Memory Controller -> Good but dangerous
      • All -> Fun and simple :)
    • Basics
      • Data type
      • Commentes
      • Functions
      • Special symbols
    • Data type
      • Int 4byte
      • Double 8byte
      • Float 4byte
      • Char 1byte
      • Bool 1byte true or false
    • Functions
      • return_type function_name(args);
      • main(){
      • function_name();
      • }
      • return_type function_name(args)
      • {
      • //
      • }
    • Another way
      • return_type function_name(args)
      • {
      • //statements
      • }
      • main(){
      • function_name();
      • }
    • Special symbols
      • new line
      •  backspace
      • tab
      • start of line
      • a Bell sound
      • ' to print '
      • ” to print “
      • ? to print ?
    • Conditions
      • If esle
      • Switch case
    • If else
      • if(condition){
      • //statments
      • }
      • Else{
      • //statmets
      • }
    • Switch case
      • switch c{
      • case a:
      • //statements;
      • break;
      • case b:
      • //statements;
      • break;
      • default:
      • //statements
      • break;
      • }
    • Loops
      • For loop
      • While
      • Do while
      • Goto
      • Break & continue
    • For loop
      • Nested for
      • for(int i=1;i<10;i++){
      • for(int j=1;j<=i;j++){
      • cout <<j<<” ”;
      • }
      • cout<<endl;
      • }
      • 1
      • 1 2
      • 1 2 3
      • 1 2 3 4
      • 1 2 3 4 5
      • 1 2 3 4 5 6
      • 1 2 3 4 5 6 7
      • 1 2 3 4 5 6 7 8
      • 1 2 3 4 5 6 7 8 9
    • while
      • while(condition)
      • {
      • //statments
      • }
    • Do while
      • {
      • //statmentes
      • }dowhile(condition)
    • GO TO
      • a: //label
      • //statments
      • if(condition){
      • goto a;
      • }
    • Pointer is very easy
      • int *xadd;
      • int x=7; --->(1)
      • int y=x; --->(2)
      • xadd=&x; -->(3)
      • cout<<x<<endl; -->(1)
      • cout<<y<<endl; -->(2)
      • cout<<xadd<<endl;(3)
      • cout<<*xadd<<endl;(3)
      • Data type *pointer _name;
      • pointer _name=&variable name
      • Data type &Reference _name=variable name;
      • ptr2 = (char*) ptr1;
      • converts ptr1 to char pointer before assigning it to ptr2.
    • Pointer Ex
      • int x=5;
      • int y=105;
      • int *p1=&x;
      • int *p2=&y;
      • cout<<&quot; p1=&quot;<<p1<<&quot;p2=&quot;<<p2;
      • cout<<&quot; x= &quot;<<x<<&quot;y=&quot;<<y;
      • y=x;
      • cout<<&quot; p1=&quot;<<p1<<&quot;p2=&quot;<<p2;
      • cout<<&quot; x= &quot;<<x<<&quot;y=&quot;<<y;
      • x=10;
      • *p2=*p1;
      • cout<<&quot; p1=&quot;<<p1<<&quot;p2=&quot;<<p2;
      • cout<<&quot; x= &quot;<<x<<&quot;y=&quot;<<y;
      • Can be =null;
      • Can be redeclared
      • Deleted by delete
      • Delete p1;
      p1= 0x222 p2=0x223 X=5 y=105 p1= 0x222 p2=0x223 X=105 y=105 p1= 0x222 p2=0x222 X=10 y=10
    • Reference Ex
      • int x=300;
      • int &ref=x;
      • cout<<&quot; x= &quot;<<x;
      • cout<<&quot; ref= &quot;<<ref;
      • ref=600;
      • cout<<&quot; x= &quot;<<xx;
      • cout<<&quot; ref= &quot;<<ref;
      • -----------------------
      • x=300 ref=300
      • X=600 ref=600
      • notes
      • Can't be=null;
      • Can't be redeclared
      • -----------------------
      • int &Ref= *(new int);
      • int x=99;
      • &Refr=x; //wrong
    • Oop
      • Constractor & destractor
      • Class
      • Header file
    • Demo
    • Data structure
      • Array
      • Linked list
    • Array
      • Data type array_name[size];
      • Multidimensional Arrays
      • Data type array_name[width,high];
    • Linked list
      • Demo
    • C/C++ under Linux
      • Install on debian family
      • sudo apt-get install gcc
      • Install on redhat family
      • yum -i gcc
      • Complie
      • gcc filename.cpp -o filename
      • Run
      • ./filename
    • Make executable file
      • Change the extension of complied file to .sh
      • then click on it ,it will run
    • Create GUI by GTK+
      • It's work under Linux and windows
      • Very beautiful
      • Free
      • examples
      • Gnome
      • Gimp
      • tutorial1
      • tutorial2
      • For c++ we use gtkmm
    • C++ and netbeans Demo
    •  
    • References
      • Robert_Lafore-Object_Oriented_Programming_in_C++
      • Data Structures and Algorithm Analysis in C
      • http://www.brpreiss.com/books/opus4/html/book.html
      • http://cpp.datastructures.net/
    • With best wishes Abuouf http://abuouf.wordpress.com [email_address]