You are on page 1of 26

A PRACTICAL TRAINING REPORT ON

“A PROJECT IN C And C++ LANGUAGE”


i-Q uest Technology

Submitted to the
Sathyabama Institute Of Science And Technology

In partial fulfillment of the degree of


BACHELOR OF ENGINEERING
ELECTRONICS & COMMUNICATION & ENGINEERING

Submitted by: Submitted to:


N.Ranjith Kumar Mr.............................
B.E. V Sem. (COUNSELOR- 'I' sec) ECE

DEPARTMENT OF ELECTRONICS & COMMUNICATION


ENGINEERING
Sathyabama Institute of Science and Technology
Sathyabama Institute of Science and
Technology

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

CERTIFICATE

This is to certify that

N.RANJITH KUMAR
Has submitted his practical training report successfully
on

“A PROJECT IN C And C++ LANGUAGE”


During academic year 2018-19

Mr.Balamurugan
Ass,Prof.
(Counselor)
SEC-'I'
ANKNOWLEDGEMENT

I owe a huge debt of thanks to a large number of people,


without whom none of would have been possible.

First and for most I am extremely grateful to Mr. HEMANT


KUMAR,
i-Quest TECHNOLOGY for allowing me to undertake this
training.

I wish my special thanks to Mr. HEMANT KUMAR for their


sagacious guidance throughout this training. Their
suggestions and prudent admonitions have been a source of
great inspiration. Without their ungrudging cooperation it
wouldn’t have been possible to complete this report.

Lastly I would like to thank all the section employees for their
kind co-operation and help, which was in abundance when
asked to make this training a successful.

N.RANJITH KUMAR
V SEM B.E. (ECE)
Sathyabama Institute of Science and
Tchnology
PREFACE

This training report is submitted as a part of the practical


training to be undertaken at “i-Quest Technology”. The
training was taken at the end of B.E. II year and its duration
was that of 30 days.

The objectives of this report are to present the “C AND C++


LANGUAGE”.

This report given all the details and description “OVERVIEW”.


"A PROJECT IN
C AND C++
LANGUAGE"

Difference Between C And C++ :-

C is a procedural language on the other hand c++ is an


object oriented language.
C follows top down approach, c++ follows bottom up
approach.
C is a low level language, c++ is a middle level language.
Input and putput functions differs in the two languages, c
uses printf and scanf whereas c++ uses >> and << as input
and output operators.
C++ can be broken down to solve real world problems which
is not the case in c.

Difference Between Declaration And Definition :-

There are basically two differences between declaration and


definition :

In declaration no space is reserved for the variable,


declaration only tells about the 'type' of the variable we are
using or we will be using int he program.
Definition on the other hand reserves the sapce for the
variable and some initial value is given to it.
Another major difference is that redeclaration is not an
error whereas redefinition is an error,
In simple words, when we declare no space is reserved for
the variable and we can redeclare it in the program
On the other hand, when we define a variable some sapce is
reserved for it to hold values plus some initial value is also
given to it, apart from it we cannot give another definition to
the variable, i.e. we cannot define it again.
Example:

extern int x -> is a declaration whereas int y is definition.

If You Want To Share Several Functions Or Variables In


Several Files Maintaining The Consistency How Would
You Share It :-

To maintain the consistency between several files firstly


place each definition in '.c' file than using external
declarations put it in '.h' file after it is included .h file we
can use it in several files using #include as it will be in one
of the header files, thus to maintain the consistency we can
make our own header file and include it where ever needed.

Translation Unit :-

A Translation Unit is a set of source files that is seen by the


compiler and it translate it as one unit which is
generally.file and all the header files mentioned in #include
directives.

When a C preprocessor expands the source file with all the


header files the result is the preprocessing translation unit
which when further processed translates the preprocessing
translation unit into translation unit, further with the help
of this translation unit compiler forms the object file and
ultimately forms an executable program.

Linkages And Types Of Linkages :-

When we declare identifiers within the same scope or in the


different scopes they can be made to refer the same object
or function with the help of likages.

There are three types of linkages:

External linkage
Internal linkage
None linkage
EXternal Linkages means 'global, non-static' functions or
variable.

Example: extern int a1

Internal Linkages means static variable and functions.


Example: static int a2

None Linkages means local variables.

Example : int a3
Keeping In Mind The Efficiency, Which One Between If-
else And Switch Is More Efficient :-

Between if-else chain and switch statements, as far as


efficiency is concerned it is hard to say that which one is
more efficient because both of them posses hardly any
difference in terms of efficiency.
Switch can ne converted into if else chain internally by the
compiler.
Switch statements are compact way of writting a jump table
whereas if-else is a long way of writting conditions.
Between if-esle and switch statements, switch cases are
prefered to be used in the programming as it is a compact
and cleaner way of writting conditions in the program.

Structures And Unions :-

While handling real world problems we come across


situations when we want to use different data type as one,
C allows the user to define it own data type known as
structures and unions.Structures and unions gathers
together different atoms of informations that comprise a
given entity.

Difference Between Structures And Unions :-

Conceptually structures and unions are same, the differnce


between them lies in their 'Memory Management' or in
simple words the memory required by them.
Elements in structures are stored in contiguous blocks,
where as in unions the memory is allocated in such a way
that the same memory allocated for one variable serves as
its memory at one occassion and as memory for another
varioable at some other occassion.
Therefore, the basic difference lies in the way mrmory is
allocated to both structures and unions.

Enumerated Data Type :-

Enumerated Data type helps the user in defining its own


data type and also gives the user an opportunity to define
what values this type can take.

The use of Enumerated Data Type maily lie when the


program get more complicated or more number of
programers are workin on it as it makes the program
listings more readable.

Preprocessor Directives In C :-

The Preprocessor processes the source program before it is


passed to the compiler. The features that preprocessor
offers are known as Prepsocessor Directives.

Preprocessing directives are lines in your program that start


with `#'. The `#' is followed by an identifier that is the
directive name. For example, `#define' is the directive that
defnes a macro. Whitespace is also allowed before and after
the `#'. A preprocessing directive cannot be more than one
line in normal circumstances. Some directive names require
arguments.View answers in details

How C Functions Prevents Rework And Therefore Saves


The Programmers Time As Well As Length Of The
Code :-

As we know that c allows us to make functions and cal


them where ever needed, it prevents rework by calling the
same function again and again where ever requires intead
for example if we make a funtion that adds two numbers, it
can be called anywhere in the program where ever the
addintion is needed and we do not need to code again for
adding any number.

It also shortens the length of the program as we do not need


to code again the same thing for next time we can simple
call the funtion and use it whenever needed.

Keyword Mean In Declaration :-

This keyword indicated that the function or the variable is


implemented externally and it emphasizes that the variable
ot the function exits external to the file or function.

We use this keyword when we want to make anything global


in the project, it does not lie within any function.

Can Union Be Self Referenced :-

No, Union cannot be self referenced because it shares a


single memory for all of its data members.View answers in
details.

Pointers :-

Pointes are special type of variables that are used to store


the memory address of the other variables.
Pointers are declared normallt as other variables withe
diffrence of * that is present in front of the pointer identifier.
There are two operators that are used with the pointers one
is '&' and another one is '*'.
& is known as address of operator and * is known as
dereferncing operator, both are prefix unary operators.

Format Specifier Used For Printing A Pointer Value :-

%p is used to display the corresponding argument that is a


pointer.
%x can also be used to print values in hexadecimal form.

Use Of 'auto' Keyword :-

The auto keyword declares a local variable whose scope


remains within the block of code, it is a variable with the
local scope.
When we declare a variable with the auto keyword it specify
that it belongs to an auto storage class.
These variables are visible only within the bolck in which
they are declared.
These types of variables are not initialised automatically
instead need to be initialised xplicitly.

Use Of Register Keyword With The Variables :-

Register keyword signifies that of possible to store variable


in the register than store it in register.
Variables are usually stored in stacks and are passed to
and fro to processor whenever required.
Also register keyword when used redused code size which is
an important thing in embeded system.

Global Variables :-

These are the variables which remains visible throughout


the program and are not recreated when they are recalled.

These types are by default initialised to zero and allocated


memory on Data Segment.View answers in details

Static Variables :-

Static is an access qualifier that limits the scope of the


variable but causes the variable to exist for the lifetime of
the program. This means a static variable is one that is not
seen outside the function in which it is declared as its
scopeis limited to the block of code in which it has been
created but its lifespan remains until the program
terminates.

The value of such a variable will remain and may be seen


even after calls to a function also the declaration statement
of such type of a variable inside a function is executed only
once.

Difference Between Global Variables And Static


Variables:-

The scope of the variable describes that the variable is


accessible at certain point in the program or not.
The difference between global variables and static variables
lies in this concept only.
The scope of the global variables remains through out the
program also the life span of these variables is through out
the program.
The scope of the static Variables remains within the block of
code in which they are created but the life span remains
through out the program.
Thus, the main difference is between the scope of both type
of variables.

Difference Between Global Variables And Local


Variable :-

First, Global variables are the variables which can be


accessed from anywhere through out the program whereas
local variables are those which can only be accessed within
the block of code in which they are created.
Second, global variables are visible throughout the program
whereas local variables are not known to the other
functions in the programs i.e. they are visible within the
block of code in which they are created.
Third, global variables are allocated memory on Data
Segament whereas local variables are allocated memory on
the stack.

Volatile Variable :-

Variables prefixed with the keyword volatile acts as a data


type qualifier. The volatile keyword attempts to alter the
default way in which the variables are stored and the way
the compiler handles the variables.

It is a kind of instruction to the optimizer to not to optimize


the varabli during compilation.

Prototype Of Printf Function :-

Prototype of printf function is:

int printf( const char *format ,?)


In this the Second parameter: '?' (Three continuous dots)
are known as called ellipsis which indicates the variable
number of arguments.

Macro :-

Macros are the identifiers that represent statements or


expressions in other words macros are fragment of code
which is been given a name. #define directive is used to
dedine a macro.
Example, we have define a macro i.e SQUARE(x) x*x.
Here the macro determines the square of the given number.
Macro Declaration: #define name text.

Disadvantage Of Using A Macro :-

The major disadvantage associated with the macro is :

When a macro is invoked no type checking is


performed.Therefore it is important to declare a macro
coreectly so that it gives a correct answer whenever it is
called inside the program.

Void Pointer :-

When we declare a variable as a pointer to a variable of type


void, it is known as void pointer. Another name for it is
generic pointer.

In general we cannot have a void type variable,but if the


variable is of void type it do not point to any data and due
to this it cannot be de-referenced.
Unnitialised Pointer :-

When we create a pointer the memory to the pointer is


allocated but the contents or value that memory has to hold
remains untouched. Unitialised pointers are those pointers
which do not hold any initial value.

Example: int *p; is said to be an unitialise pointer, it is


recomended to initialise the pointer before actually using it
as it an error.

Dangling Pointer :-

These are the pointers that do not point to any object of


appropriate type. These are special cases of memory
vialation as they do not point to any appropraite type.These
arises when some object is deleted from the memory or
when an object is deallocated thus the pointer keeps on
pointin to the memory location untill it is modified.
Dangling pointers may lead to unpredictable results.

Near, Far And Huge Pointer :-


A near pointer is a 16 bit pointer to an object which is
contained in the current segment like code segment, data
segment, stack segment and extra segment. It holds only
offset address.
A far pointer is a 32 bit pointer to an object anywhere in
memory. It can only be used when the compiler allocates a
segment register, or we can say the compiler must allocate
segment register to use far pointers. These pointers hold 16
bit segment and 16 bit offset address.
Huge pointers are also far pointers i.e. 32 bit pointer the
difference is that the huge pointer can be increased or
decreased uniformly between any segments and can have
any value from 0 to 1MB.

Null Pointer :-

NULL pointer is not the unitialised pointer that can point


anywhere, the NULL pointers are the one which do not point
anywhere that is which do not point to any object or any
function.

GSM Services
1 Services are defined as anything the end user explicitly
sees as worth paying for.
2 The primary objectives of a mobile telephony system are
to allow mobile subscribers to communicate effectively.
3 Services are defined as anything the end user explicitly
sees as worth paying for.

SERVICE CATEGORIES

Main types of telecommunication services:


4 Basic services:
Available to all subscribers to a mobile network.
e.g. voice telephone calls.
5 Supplementary services:
Additional services those are available by subscription
only.
e.g. call forwarding.

Basic Telecommunication Services:


To main categories:
6 Teleservices
7 Bearer Services

Basic Telecommunication Services Teleservices

Teleservice allows the subscriber to communicate (usually via


voice, fax, data or SMS) with another subscriber.
It is a complete system including necessary terminal
equipment.

Basic Telecommunication Services:


Bearer services

It transports speech and data as digital information within the


network between user interfaces.
e.g.- a bearer service associated with the speech telephony
teleservices is the timeslot assigned to a call on a TDMA frame
over the air interface.

TELESERVICES
Emergency calls

The emergency call function enable a subscriber to make an


emergency call by pressing a predefined button or by using the
emergency number. (Like 112,911).

Dual Tone Multi Frequency (DTMF)


A tone signaling facility which is often used for various control
purposes, such as remote control of answering machines and
interacting with automated telephone services.

SMS Cell Broadcast (SMSCB)


A text message with a maximum length of 93 characters can
be broadcast to all mobiles within a certain geographic area.
Traffic congestion warning accident reports, weather
announcements an advertisement.

Voice mail
This service is an answering machine within the network that
is controlled by the subscriber. The subscriber accesses the
mail box using a personal security code.

SUPPLEMENTARY SERVICES

Call forwarding
Ability to forward incoming call to another telephone number
in the following situation:

8 Call forwarding on MS not reachable


9 Call forwarding on MS busy
10 Call forwarding on no reply
11 Call forwarding, unconditional

Barring of outgoing calls


The subscriber can activate or deactivate this service from the
MS with a variety of options for barring outgoing calls.
12 Bar all outgoing calls
13 Bar all outgoing international calls
14 Bar all outgoing international calls except those directed
to home PLMN.

Barring of incoming calls


This is desirable because in some cases the called mobile
subscriber is charged for parts of an incoming call (during
international roaming)
15 Barring of all incoming calls
16 Barring of incoming calls when outside home PLM

Call waiting
17 This service notifies the mobile subscribers, usually by
an audible tone, for incoming call.
18 The incoming call can be any type of basic service
including speech, data or fax.
19 There is no notification in the case of an emergency call
or SMS.

Call hold
This supplementary service in enable the subscribers to put
the basic normal telephony service on hold in order to set up a
new call or accept a waiting call.

Calling line identification services:


These cover both the presentation and restriction of the calling
line identity. The presentation part of the service supplies the
called party with the ISDN or MSISDN number of the calling
party. The restriction service enables calling parties to restrict
the presentation of their number on the MSs of calling parties.

Closed User Group (CUG)


The CUG service enables subscribers connected to the
PLMN/ISDN and possibly other networks, to form groups in
which access is restricted.
E.g.: Members of a specific CUG can communicate with each
other, but generally not with users outside the group.

INNOVATIVE FEATURES
Regional and local subscription

These features allow subscribers to subscribe to a service in a


specified geographical area.
Requests for service outside the area are rejected with the
exception of emergency calls and SMS.
For local subscriptions, the geographical area consists of a
number of cells, and for regional subscription, the area
consists of LAs.

Value Added Services

20 Mobile messaging
21 Mobile internet
22 Mobile intelligent Network Services
Mobile Messaging

23 SMS
24 EMS
25 MMS
26 Instant Messaging
27 Streaming

Short Message Services (SMS)


The service allows simple text message consisting of a
maximum of 160 alphanumeric characters to be sent to or
from an MS.
If the switched off, or has left the coverage area, the message
is store in a Short Message Services Center (SMSC).
When the mobile is switched on again or has re-entered the
network coverage area, the subscriber is informed that there is
a message.

Enhanced Messaging System (EMS)


28 EMS can support relatively simple pictures, sounds and
animation.
29 EMS messages that are sent to devices that do not
support it will be displayed as SMS transmissions.
30 It is a 3GPP standard.

Multimedia Message Service (MMS)


31 MMS means a multimedia presentation which consists of
music, voice, image, text, video and graphics all
synchronized across a common line.
32 “Synchronized Power Point Presentation”.
33 MMS-enabled mobile phones enable subscribes to
compose and send messages with one or more
multimedia parts. Mobiles phones with built-in or
attached cameras or with built-in MP3 players are very
likely to also have an MMS messaging client-- a software
program that interacts with the mobile subscribers to
compose, address, send, receive, and view MMS
messages.

The Greeting Card solution:


34 Send message to your friend, family and loved ones:
- Via the web to the mobile phone.
35 Ease of use- self instructing – Drag ‘n’ Drop
36 Animations, Sounds, Pictures & Text

MESSAGING CONTENT
CARRIED
TYPE

STREAMING

REAL TIME DISTRIBUTION OF AUDIO, VIDEO AND


MULTIMEDIA

INSTANT
MESSAGING REAL TIME TEXT BASED
COMMUNICATION

MMS
PICTURE, SOUNDS AND ANIMATIONS

EMS
RELATIVELY SIMPLE PICTURES, SOUNDS AND ANIMATIONS

SMS
SIMPLE TEXT

WIRELESS MESSAGING LADDER

Location Based Applications


In this of significant telecommunication competition, mobile
network operators continuously seek new and innovative ways
to create differentiation and increase profits. One of the best
ways to do accomplish this is through the delivery of highly
personalized services. One of the most powerful ways to
personalize mobile services is based on location.

Positioning
One of the most obvious technologies behind LBS is
positioning, with the most widely recognized system being the
Global Positioning System (GPS).There are however, other
means of positioning in addition to GPS. These other
technologies are network based positioning and typically rely
on various means of triangulation of the signal from cell sites
serving a mobile phone. In addition, the serving cell site can be
used as a fix or location of the user.

Geographic Information Systems


Geographic data is an important aspect of any location
system. Geographic Information Systems (GIS) provide the
tools to provision and administer base map data such as man
made structures (streets, building) and terrain (mountains,
rivers). GIS is also used to manage point-of-interest data such
as location of gas stations, restaurants, nightclubs etc. Finally,
GIS information about the radio frequency characteristics of
the mobile network. This allows the system to determine the
serving cell site of the user.

LOCATION BASED SERVICE


Service Segments
37 Safety
38 Community
39 Personal Lifestyles
40 Tracking

SAFETY
41 Emergency Dispatch
42 Child/Family tracing
43 Auto theft tracking
44 Roadside assistance

COMMUNITY
45 Friend Finder
46 Dating
47 Chatting

PERSONAL LIFESTYLES
48 Entertainment & Fun
49 Finding & Guiding
50 Information services

TRACKING
51 Fleet Management
52 Vehicle dispatch
53 Rental car tracking
54 Remote workforce management

Machine to Machine communication (M2M)


Some key technologies for M2M
55 Bluetooth
56 GSM/GPRS
57 GSM/SMS
58 WiFi

Special Features of Pre-Paid Service


59 Community charging
60 Personalized Service offering
61 Pre/Post paid convergence
62 Real-time tariff based on accumulated usage

Special Features of Pre-Paid Service-1


63 Bonus communications
64 Telescopic charging
65 Balance dependent tariff
66 Negative Balance

Special Features of Pre-Paid Service-2


67 Friend & Family for voice & SMS
68 Multi-user Account
69 Max. balance check before credit update for avoiding
fraud
70 Fax and data calls
71 Low credit warning during conversation
Push-To-Talk (PTT)
PTT is a two way communication service that works like a
“walkie talkie”.
A normal cell phone call is full-duplex, meaning both parties
can hear each other at the same time. PTT is half-duplex,
meaning communication can only travel in one direction at
any given moment.

Push-To-Talk over cellular (PoC)


The Motorola, Nokia, Ericsson, Siemens, Huawei, Mobile
Tornado, Wireless ZT, LG, etc. versions of PTT are based on
2.5G or 3G packet-switched network and use SIP & RTP
protocols. These particular versions of PTT are called “Push to
Talk over Cellular”.

You might also like