CPP-Lecture-05 ..
CPP-Lecture-05 ..
(Using C++)
Huma Israr
Department Of Information Engineering Technology
National Skills University, Islamabad.
[email protected]
Fall 2023, BS-CS
2
Week 04
Lecture – 01
Lecture – 02
Variables and Data-types
Semester Calendar
3
Class Schedule
Simple Structured
Address
float double long double
pointer reference
C++ Primitive Data Types:
Primitives data types are built-in or predefined data types and can be
used directly by the user to declare variables.
Primitive types
integral floating
unsigned
Primitive Data Types in C++
Integral Types int sample values
4578 -4578 0
represent whole numbers and their negatives
declared as int, short, or long
{
char a = 65, b = 66, c = 67;
cout << a;
cout << b;
cout << c; }
String Type
The string type is used to store a sequence of characters
(text). This is not a built-in type, but it behaves like one in its
most basic usage. String values must be surrounded by double
quotes
string greeting = "Hello";
cout << greeting;
Note:To use strings, you must include an additional header file in the source
code, the <string> library
Any Question