0% found this document useful (0 votes)
89 views22 pages

Q1-Chapter Review

The document provides an overview of key concepts in C/C++ programming including software categories, computer languages, compilers, data types, header files, and standard header files. It defines system software, application software, machine language, assembly language, and high-level languages. It also describes primitive data types like int, char, bool, float, and void as well as derived types like arrays, pointers, references, classes, structures, unions, and enumerations. Finally, it lists common standard header files and their uses.

Uploaded by

Elisha Nazario
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views22 pages

Q1-Chapter Review

The document provides an overview of key concepts in C/C++ programming including software categories, computer languages, compilers, data types, header files, and standard header files. It defines system software, application software, machine language, assembly language, and high-level languages. It also describes primitive data types like int, char, bool, float, and void as well as derived types like arrays, pointers, references, classes, structures, unions, and enumerations. Finally, it lists common standard header files and their uses.

Uploaded by

Elisha Nazario
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

C/C++ Programming

Chapter 1: Lesson Review


Quick Review
Terminologies

Software Categories:

• System Software
• Programs written for computer systems
• Application Software
• Programs written for computer users
Terminologies

Computer Languages:

• Machine Language
• Uses binary code, Machine-dependent, Not portable
• Assembly Language
• Uses mnemonics, Machine-dependent, Not usually portable
• High-Level Language
• Uses English-like language, Machine independent, Portable
Terminologies

• A Compiler is a program or a software that transforms


programs written in High Level Programming Languages
• Turbo C is a C Programming Language Compiler that
transforms programs written in C to Assembly or Machine
Code to create an executable Program.
• Turbo C and Turbo C++ are compilers for C and C++ (C plus
plus) Programming Languages. They were originally
developed by Borland Software Corporation
Terminologies

Syntax
• is the set of rules that defines the combinations of symbols
that are considered to be correctly structured statements or
expressions in that language.

Semantics
• is the field concerned with the rigorous mathematical study of
the meaning of programming languages.
Data Types

•Primitive Data Types


•Derived Data Types
•Abstract or User-Defined
Data Types
Primitive Data Types

• Integer
• Character
• Boolean
• Floating Point
• Double Floating Point
• Valueless or Void
• Wide Character
Primitive Data Types

• Integer:
• Keyword used for integer data types is int. Integers typically requires 4 bytes of memory space
and ranges from -2147483648 to 2147483647.
• Character:
• Character data type is used for storing characters. Keyword used for character data type is char.
Characters typically requires 1 byte of memory space and ranges from -128 to 127 or 0 to 255.
• Boolean:
• Boolean data type is used for storing boolean or logical values. A boolean variable can store
either true or false. Keyword used for boolean data type is bool.
• Floating Point:
• Floating Point data type is used for storing single precision floating point values or decimal
values. Keyword used for floating point data type is float. Float variables typically requires 4 byte
of memory space.
Primitive Data Types

• Double Floating Point: Double Floating Point data type is used for
storing double precision floating point values or decimal values.
Keyword used for double floating point data type is double. Double
variables typically requires 8 byte of memory space.
• void: Void means without any value. void datatype represents a
valueless entity. Void data type is used for those function which
does not returns a value.
• Wide Character: Wide character data type is also a character data
type but this data type has size greater than the normal 8-bit
datatype. Represented by wchar_t. It is generally 2 or 4 bytes long.
Derived Data Types

• The data-types that are derived from the primitive or built-


in datatypes are referred to as Derived Data Types.
• Function
• Array
• Pointer
• Reference
Derived Data Types

Function
• A function is a block of code or program-segment that is
defined to perform a specific well-defined task.
Array
• An array is a collection of items stored at continuous
memory locations. The idea of array is to represent many
instances in one variable.
Derived Data Types

Pointers
• Pointers are symbolic representation of addresses.
Reference
• When a variable is declared as reference, it becomes an
alternative name for an existing variable
Abstract or User-Defined Data Types

These data types are defined by user itself.


• Class
• Structure
• Union
• Enumeration
• Typedef defined DataType
Abstract or User-Defined Data Types

Class
• It is a user-defined data type, which holds its own data members
and member functions, which can be accessed and used by creating
an instance of that class. A class is like a blueprint for an object.
Structure
• A structure is a user defined data type in C/C++. A structure creates
a data type that can be used to group items of possibly different
types into a single type.
Abstract or User-Defined Data Types

Union
• Like Structures, union is a user defined data type. That all
members share the same memory location.
Enumeration
• It is mainly used to assign names to integral constants, the
names make a program easy to read and maintain.
Typedef 
• Using typedef does not actually create a new data class, rather
it defines a name for an existing type.
Header Files

• contain the set of predefined standard library functions.


• #include (as directive)
• All the header file have a ‘.h’ an extension.

A header file contains:


• Function definitions
• Data type definitions
• Macros
2 types of header file

• Pre-existing header files: Files which are already


available in C/C++ compiler we just need to import
them.

• User-defined header files: These files are defined by


the user and can be imported using “#include”.
2 types of header file

• Pre-existing header files: Files which are already


available in C/C++ compiler we just need to import
them.

• User-defined header files: These files are defined by


the user and can be imported using “#include”.
Standard Header Files And Their Uses

• #include<stdio.h>
• It is used to perform input and output operations using
functions scanf() and printf().
• #include<iostream>
• It is used as a stream of Input and Output using cin and
cout.
• #include<string.h>
• It is used to perform various functionalities related to string
manipulation like strlen(), strcmp(), strcpy(), size(), etc.
Standard Header Files And Their Uses

• #include<math.h>
• It is used to perform mathematical operations like sqrt(), log2(),
pow(), etc.
• #include<time.h>
• It is used to perform functions related to date() and time() like
setdate() and getdate(). It is also used to modify the system date
and get the CPU time respectively.
• #include<float.h>
• It contains a set of various platform-dependent constants related
to floating point values.

You might also like