Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

Class notes Of C++

Beoordeling
-
Verkocht
-
Pagina's
17
Geüpload op
04-06-2024
Geschreven in
2023/2024

It's an document on complete notes about Object Oriented Programming Using C++ under an University of Madras. The Notes given in above document will make you to know about complete theory of C++ Programming Language.

Instelling
Vak

Voorbeeld van de inhoud

C++ Introduction and Basic
Features
Variables and Basic Data Types

 In C++, we have different types of variables:
+Integral types: char , short , int , long ,
and long long +Floating-point
types: float , double , and long
double +Boolean type: bool (true or false)

 To declare a variable, use the following syntax:
+ datatype variablename; +For example: int
myNumber;

 Variables need to be initialized before use.
 To initialize a variable, use the following syntax:
+ datatype variablename = value; +For
example: int myNumber = 5;

Strings, Vectors, Arrays

 In C++, we can use arrays, vectors, and strings to
store data.
 Arrays are used to store a fixed-size sequence of
elements of the same type.
 To declare an array, use the following syntax:
+ datatype variablename[array_size]; +For
example: int myArray[5];

 Strings are similar to arrays, but they are used to
store a sequence of characters.
 To declare a string, use the following syntax:
+ string variablename; +For

, example: string myString = "Hello,
World!";

 Vectors are dynamic arrays that can grow or
shrink in size.
 To declare a vector, use the following syntax:
+ vector<datatype> variablename; +For
example: vector<int> myVector;

Expressions and Statements

 Expressions are used to compute a value. +For
example: 2 + 2

 Statements are used to control the flow of a
program. +For example: if (x > 0) { ... }

 The basic statements in C++ are: +Selection
statements: if , if-else , switch +Iteration
statements: while , do-while , for +Jump
statements: break , continue , goto , return

Functions

 A function is a reusable block of code that
performs a specific task.
 To declare a function, use the following syntax:
+ return_type function_name(parameters)
{ ... } +For example: int add(int a, int
b) { return a + b; }

 Functions can be called from other parts of the
program by using their name.
Classes and Object-oriented Programming

,  In C++, classes are used to create objects that
have their own properties and behaviors.
 To declare a class, use the following syntax:
+ class class_name { ... }; +For
example: class Car { ... };

 Objects are instances of classes that have their
own state and behavior.
 Objects are created using the new keyword.

 Objects are destroyed using the delete keyword.

Input/Output Library and Concepts

 In C++, the iostream library is used for
input/output operations.
 To include the library, use the following syntax:
+ #include <iostream>

 The std::cout object is used to print output to
the console.
 The std::cin object is used to read input from
the console.
 The std::endl object is used to insert a new line
character at the end of an output operation.
This is a brief introduction to the topics related to C++
Introduction and Basic Features. These topics cover the
basics of variables, data types, arrays, strings,
expressions, statements, functions, and classes, as well
as the Input/Output library and concepts. Students can
use these notes to study for exams and to learn the
basics of C++ programming.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
4 juni 2024
Aantal pagina's
17
Geschreven in
2023/2024
Type
College aantekeningen
Docent(en)
Mrs.sree mathi
Bevat
Alle colleges

Onderwerpen

$8.59
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
lokeshs2

Maak kennis met de verkoper

Seller avatar
lokeshs2 St Joseph College
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
1 jaar
Aantal volgers
0
Documenten
1
Laatst verkocht
-

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen