ECEng2052 Chapter 1: C++ Basics

CongratulatoryDubnium avatar
CongratulatoryDubnium
·
·
Download

Start Quiz

Study Flashcards

6 Questions

What is C++?

A general-purpose programming language that was developed as an extension of the C programming language

Who developed C++?

Bjarne Stroustrup

What does the '++' in C++ stand for?

Incremental improvement on C

What is the purpose of the #include directive in a C++ program?

To include the standard input-output stream library

What is the purpose of the 'using namespace std;' directive in a C++ program?

To allow the use of the standard library

What is the purpose of the 'int main()' function in a C++ program?

To indicate the entry point of the program

Study Notes

C++ Basics

  • C++ is a general-purpose programming language developed as an extension of the C programming language.
  • It was created by Bjarne Stroustrup at Bell Labs in the early 1980s.
  • C++ allows programmers to write software that can be compiled and run on many different systems with minimal customization.
  • The language started as an extension of C but added support for classes and objects.
  • The name "C++" is a wordplay because, in the syntax of C, the ++ operator adds an increment, implying an incremental improvement on C.

Structure of C++ Program

  • A C++ program consists of:
    • Preprocessor directives
    • using namespace std; to allow the use of the standard library
    • int main() as the entry point of the program where execution begins
    • return 0; to indicate successful completion of the program

Example Program

  • An example program to display "Hello welcome to C++" would include:
    • #include to include the standard input-output stream library
    • using namespace std;
    • int main() as the entry point
    • cout to display the output "Hello welcome to C++"

Introduction to C++ programming language, its history, features and advantages. Learn about the creator of C++ and its ability to compile and run on many systems.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Introduction to C++ Programming
14 questions
Programming Loops in C++
5 questions

Programming Loops in C++

RapturousStatistics avatar
RapturousStatistics
Use Quizgecko on...
Browser
Browser