SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
C++	
  -­‐	
  for	
  Java	
  Developers:	
  
               Intro	
  to	
  C++	
  
            Jussi	
  Pohjolainen	
  
Tampere	
  University	
  of	
  Applied	
  Sciences	
  
C++	
  
•  1998	
  ANSI/ISO	
  Standard:	
  
    –  Core	
  language	
  
    –  Standard	
  Library	
  
•  Many	
  C++	
  libraries	
  exist	
  that	
  are	
  not	
  part	
  of	
  
   the	
  standard	
  	
  
•  New	
  standard:	
  ISO/IEC:2011	
  C++11	
  
C++	
  Standard	
  Library	
  
•  Containers	
  
    –  array,	
  bitset,	
  deque,	
  forward_list,	
  list,	
  …	
  vector	
  
•  General	
  
    –  algorithm,	
  funcUonal,	
  iterator,	
  locale,	
  memory…	
  
•  Strings	
  
    –  string	
  
•  Input	
  and	
  Output	
  
    –  ios,	
  iostream,	
  ostream,	
  sstream..	
  
•  Numerics	
  
    –  complex,numeric,	
  valarray	
  
•  Language	
  support	
  
    –  excepUon,	
  limits,	
  new,	
  typeinfo	
  
C	
  Standard	
  Library	
  
•  Macros,	
  typedefiniUons,	
  funcUons	
  for	
  tasks	
  
   like	
  string	
  handling,	
  mathemaUcal	
  
   computaUons,	
  memory	
  allocaUons..	
  
•  See:	
  
   –  hYp://en.wikipedia.org/wiki/C_standard_library	
  
Diagram	
  from:	
  
hYp://faculty.cs.niu.edu/~mcmahon/CS241/Notes/compile.html	
  
GCC	
  Compiler	
  
•  The	
  GNU	
  Compiler	
  CollecUon	
  (GCC)	
  is	
  a	
  
   compiler	
  system	
  produced	
  by	
  the	
  GNU	
  Project	
  
   supporUng	
  various	
  programming	
  languages.	
  
•  C	
  (gcc),	
  C++	
  (g++),	
  ObjecUve-­‐C	
  (gobjc),	
  Fortran	
  
   (gfortran),	
  Java	
  (gcj)	
  
•  CompaUble	
  IDEs	
  
    –  Dev-­‐C++	
  (Win),	
  NetBeans,	
  Eclipse,	
  QtCreator,	
  
       Xcode	
  
Installing	
  
•  Ubuntu	
  
    –  sudo	
  apt-­‐get	
  install	
  g++	
  
•  Mac	
  OS	
  X	
  
    –  Install	
  Xcode	
  and	
  install	
  command	
  line	
  tools	
  
•  Windows	
  
    –  For	
  example	
  minGW:	
  hYp://sourceforge.net/
       projects/mingw/	
  
Compiling	
  C++	
  Program	
  
•  Simple	
  
   –  g++ mysourcecode.cpp
•  BeYer	
  
   –  g++ -ansi -pedantic -wall
      mysourcecode.cpp -o myapp
•  Running	
  
   –  ./myapp
Code	
  Style	
  
•  Java	
  has	
  “standard”	
  for	
  code	
  style,	
  C++	
  does	
  
   not.	
  
•  Use	
  can	
  use	
  separate	
  apps	
  for	
  “preffy”	
  your	
  
   source	
  code	
  
•  For	
  example:	
  ArUsUc	
  Style	
  
    –  hYp://astyle.sourceforge.net/	
  
Makefiles	
  
•  All	
  these	
  command	
  line	
  arguments	
  can	
  be	
  
   long	
  and	
  hard	
  to	
  write.	
  
•  Use	
  Make!	
  UUlity	
  that	
  automaUcally	
  builds	
  
   apps.	
  
•  hYp://en.wikipedia.org/wiki/Make_(sohware)	
  
makefile
WHAT	
  ABOUT	
  QT?	
  
Qt	
  Hello	
  World	
  
#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QPushButton hello("Hello world!");
    hello.resize(100, 30);

    hello.show();
    return app.exec();
}
SOME	
  C++	
  SYNTAX	
  
cout	
  for	
  output,	
  cin	
  for	
  input	
  
•  Output	
  
    –  cout	
  <<	
  “hello!”;	
  
•  Input	
  
    –  cin	
  >>	
  someVariable;	
  
Datatypes	
  
•  Fundamental	
  types	
  
    –  int,	
  short,	
  long	
  
    –  float,	
  double,	
  long	
  double	
  
    –  bool	
  
    –  char	
  
•  Derived	
  types	
  
    –  arrays,	
  pointers,	
  references..	
  
•  Class	
  types	
  
    –  class,	
  struct,	
  union	
  
const	
  and	
  enum	
  
// Like final in Java
const int NUMBER = 100;
// Using enums
enum DAY { MON = 1, TUE, WED, THU, FRI,
SAT, SUN };
DAY today = MON;
CondiUons	
  in	
  C++	
  
int a = 0;
if(a = 0)
{
   cout << “What the..” << endl;
}
Arrays	
  
const int LENGTH = 5;
int numbers[LENGTH];
numbers[0] = 12;
numbers[1] = 88;
..
About	
  Strings	
  
•  C++	
  has	
  two	
  kind	
  of	
  Strings	
  
    –  char	
  arrays	
  
    –  string	
  –	
  class	
  
C	
  type	
  strings	
  
•  char	
  myString[6]	
  =	
  “Jussi”;	
  
•  //	
  Why	
  6??	
  The	
  array	
  contains	
  now	
  Jussi0!	
  
•  char	
  myString[]	
  =	
  “Jussi”	
  
cin.get	
  
// Reads maxLength number of chars
// from the user
cin.get(myString, maxLength);
// This leaves user given enter ‘n’ to input
// stream, use cin.get again to get rid of
//it..

Más contenido relacionado

La actualidad más candente

C programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti DokeC programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti DokePranoti Doke
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpen Gurukul
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming LanguageAhmad Idrees
 
C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)Dushmanta Nath
 
Tutorial on c language programming
Tutorial on c language programmingTutorial on c language programming
Tutorial on c language programmingSudheer Kiran
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01Wingston
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming LanguageSteve Johnson
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++ Bharat Kalia
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programminggajendra singh
 
Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1Ali Aminian
 
Advanced C Language for Engineering
Advanced C Language for EngineeringAdvanced C Language for Engineering
Advanced C Language for EngineeringVincenzo De Florio
 
Overview of c++ language
Overview of c++ language   Overview of c++ language
Overview of c++ language samt7
 
C the basic concepts
C the basic conceptsC the basic concepts
C the basic conceptsAbhinav Vatsa
 

La actualidad más candente (20)

C programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti DokeC programming_MSBTE_Diploma_Pranoti Doke
C programming_MSBTE_Diploma_Pranoti Doke
 
C Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.comC Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.com
 
C programming language
C programming languageC programming language
C programming language
 
C program
C programC program
C program
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C Programming
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
 
C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)
 
Tutorial on c language programming
Tutorial on c language programmingTutorial on c language programming
Tutorial on c language programming
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming Language
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++
 
c++
 c++  c++
c++
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
C Programming
C ProgrammingC Programming
C Programming
 
Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1
 
Advanced C Language for Engineering
Advanced C Language for EngineeringAdvanced C Language for Engineering
Advanced C Language for Engineering
 
Overview of c++ language
Overview of c++ language   Overview of c++ language
Overview of c++ language
 
Intro to c++
Intro to c++Intro to c++
Intro to c++
 
C the basic concepts
C the basic conceptsC the basic concepts
C the basic concepts
 

Destacado

Destacado (11)

Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
 
01 c++ Intro.ppt
01 c++ Intro.ppt01 c++ Intro.ppt
01 c++ Intro.ppt
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
C++ programming
C++ programmingC++ programming
C++ programming
 
20130110 prs presentation ncim c++ 11
20130110 prs presentation ncim c++ 1120130110 prs presentation ncim c++ 11
20130110 prs presentation ncim c++ 11
 
C++ language
C++ languageC++ language
C++ language
 
presentation on C++ basics by prince kumar kushwaha
presentation on C++ basics by prince kumar kushwahapresentation on C++ basics by prince kumar kushwaha
presentation on C++ basics by prince kumar kushwaha
 
Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
C++ Programming Language
C++ Programming Language C++ Programming Language
C++ Programming Language
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
 

Similar a Intro to C++ - language

C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with Cgpsoft_sk
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.pptInfotech27
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.pptTeacherOnat
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.pptJayarAlejo
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.pptJayarAlejo
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.pptEPORI
 
C++ programming: Basic introduction to C++.ppt
C++ programming: Basic introduction to C++.pptC++ programming: Basic introduction to C++.ppt
C++ programming: Basic introduction to C++.pptyp02
 
Abhishek lingineni
Abhishek lingineniAbhishek lingineni
Abhishek lingineniabhishekl404
 
CPlusPus
CPlusPusCPlusPus
CPlusPusrasen58
 
Cs1123 11 pointers
Cs1123 11 pointersCs1123 11 pointers
Cs1123 11 pointersTAlha MAlik
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.pptDevliNeeraj
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overviewTAlha MAlik
 

Similar a Intro to C++ - language (20)

C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with C
 
OpenCL Heterogeneous Parallel Computing
OpenCL Heterogeneous Parallel ComputingOpenCL Heterogeneous Parallel Computing
OpenCL Heterogeneous Parallel Computing
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.ppt
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.ppt
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.ppt
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.ppt
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.ppt
 
C++_programs.ppt
C++_programs.pptC++_programs.ppt
C++_programs.ppt
 
C++ programming: Basic introduction to C++.ppt
C++ programming: Basic introduction to C++.pptC++ programming: Basic introduction to C++.ppt
C++ programming: Basic introduction to C++.ppt
 
Intro to .NET and Core C#
Intro to .NET and Core C#Intro to .NET and Core C#
Intro to .NET and Core C#
 
Abhishek lingineni
Abhishek lingineniAbhishek lingineni
Abhishek lingineni
 
CPlusPus
CPlusPusCPlusPus
CPlusPus
 
Cs1123 11 pointers
Cs1123 11 pointersCs1123 11 pointers
Cs1123 11 pointers
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
Return of c++
Return of c++Return of c++
Return of c++
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
 
c++ ppt.ppt
c++ ppt.pptc++ ppt.ppt
c++ ppt.ppt
 

Más de Jussi Pohjolainen

libGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferenceslibGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferencesJussi Pohjolainen
 
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationlibGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationJussi Pohjolainen
 
Intro to Building Android Games using libGDX
Intro to Building Android Games using libGDXIntro to Building Android Games using libGDX
Intro to Building Android Games using libGDXJussi Pohjolainen
 
Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript DevelopmentJussi Pohjolainen
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame AnimationJussi Pohjolainen
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame AnimationJussi Pohjolainen
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDXJussi Pohjolainen
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDXJussi Pohjolainen
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesJussi Pohjolainen
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platformJussi Pohjolainen
 

Más de Jussi Pohjolainen (20)

Moved to Speakerdeck
Moved to SpeakerdeckMoved to Speakerdeck
Moved to Speakerdeck
 
Java Web Services
Java Web ServicesJava Web Services
Java Web Services
 
Box2D and libGDX
Box2D and libGDXBox2D and libGDX
Box2D and libGDX
 
libGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferenceslibGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and Preferences
 
libGDX: Tiled Maps
libGDX: Tiled MapslibGDX: Tiled Maps
libGDX: Tiled Maps
 
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationlibGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame Animation
 
Intro to Building Android Games using libGDX
Intro to Building Android Games using libGDXIntro to Building Android Games using libGDX
Intro to Building Android Games using libGDX
 
Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript Development
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
libGDX: Scene2D
libGDX: Scene2DlibGDX: Scene2D
libGDX: Scene2D
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
 
libGDX: User Input
libGDX: User InputlibGDX: User Input
libGDX: User Input
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDX
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDX
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platform
 
Intro to Asha UI
Intro to Asha UIIntro to Asha UI
Intro to Asha UI
 

Último

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Último (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Intro to C++ - language

  • 1. C++  -­‐  for  Java  Developers:   Intro  to  C++   Jussi  Pohjolainen   Tampere  University  of  Applied  Sciences  
  • 2. C++   •  1998  ANSI/ISO  Standard:   –  Core  language   –  Standard  Library   •  Many  C++  libraries  exist  that  are  not  part  of   the  standard     •  New  standard:  ISO/IEC:2011  C++11  
  • 3. C++  Standard  Library   •  Containers   –  array,  bitset,  deque,  forward_list,  list,  …  vector   •  General   –  algorithm,  funcUonal,  iterator,  locale,  memory…   •  Strings   –  string   •  Input  and  Output   –  ios,  iostream,  ostream,  sstream..   •  Numerics   –  complex,numeric,  valarray   •  Language  support   –  excepUon,  limits,  new,  typeinfo  
  • 4. C  Standard  Library   •  Macros,  typedefiniUons,  funcUons  for  tasks   like  string  handling,  mathemaUcal   computaUons,  memory  allocaUons..   •  See:   –  hYp://en.wikipedia.org/wiki/C_standard_library  
  • 5.
  • 7.
  • 8. GCC  Compiler   •  The  GNU  Compiler  CollecUon  (GCC)  is  a   compiler  system  produced  by  the  GNU  Project   supporUng  various  programming  languages.   •  C  (gcc),  C++  (g++),  ObjecUve-­‐C  (gobjc),  Fortran   (gfortran),  Java  (gcj)   •  CompaUble  IDEs   –  Dev-­‐C++  (Win),  NetBeans,  Eclipse,  QtCreator,   Xcode  
  • 9. Installing   •  Ubuntu   –  sudo  apt-­‐get  install  g++   •  Mac  OS  X   –  Install  Xcode  and  install  command  line  tools   •  Windows   –  For  example  minGW:  hYp://sourceforge.net/ projects/mingw/  
  • 10.
  • 11.
  • 12.
  • 13. Compiling  C++  Program   •  Simple   –  g++ mysourcecode.cpp •  BeYer   –  g++ -ansi -pedantic -wall mysourcecode.cpp -o myapp •  Running   –  ./myapp
  • 14. Code  Style   •  Java  has  “standard”  for  code  style,  C++  does   not.   •  Use  can  use  separate  apps  for  “preffy”  your   source  code   •  For  example:  ArUsUc  Style   –  hYp://astyle.sourceforge.net/  
  • 15.
  • 16. Makefiles   •  All  these  command  line  arguments  can  be   long  and  hard  to  write.   •  Use  Make!  UUlity  that  automaUcally  builds   apps.   •  hYp://en.wikipedia.org/wiki/Make_(sohware)  
  • 18.
  • 20. Qt  Hello  World   #include <QApplication> #include <QPushButton> int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton hello("Hello world!"); hello.resize(100, 30); hello.show(); return app.exec(); }
  • 22. cout  for  output,  cin  for  input   •  Output   –  cout  <<  “hello!”;   •  Input   –  cin  >>  someVariable;  
  • 23. Datatypes   •  Fundamental  types   –  int,  short,  long   –  float,  double,  long  double   –  bool   –  char   •  Derived  types   –  arrays,  pointers,  references..   •  Class  types   –  class,  struct,  union  
  • 24. const  and  enum   // Like final in Java const int NUMBER = 100; // Using enums enum DAY { MON = 1, TUE, WED, THU, FRI, SAT, SUN }; DAY today = MON;
  • 25. CondiUons  in  C++   int a = 0; if(a = 0) { cout << “What the..” << endl; }
  • 26. Arrays   const int LENGTH = 5; int numbers[LENGTH]; numbers[0] = 12; numbers[1] = 88; ..
  • 27. About  Strings   •  C++  has  two  kind  of  Strings   –  char  arrays   –  string  –  class  
  • 28. C  type  strings   •  char  myString[6]  =  “Jussi”;   •  //  Why  6??  The  array  contains  now  Jussi0!   •  char  myString[]  =  “Jussi”  
  • 29. cin.get   // Reads maxLength number of chars // from the user cin.get(myString, maxLength); // This leaves user given enter ‘n’ to input // stream, use cin.get again to get rid of //it..