Dynamic Objects,Pointer to function,Array & Pointer,Character String ProcessingMeghaj Mallick
This is an PPT of C++ Programming Language. This includes the various topics such as "Dynamic Objects,Pointer to function,Array & Pointer,Character String Processing ".
c++ arrays and pointers grade 9 STEP curriculum.pptxJanineCallangan
A pointer in C++ is a variable that stores the memory address of another variable. Pointers allow indirect access to and manipulation of data in memory. Pointers are declared with a specific data type and initialized by assigning the address of a variable using the address-of operator (&). Pointer arithmetic allows traversing arrays efficiently by performing operations on pointers. There are normal pointers that point to a specific data type, void pointers that can point to any type, and null pointers initialized to nullptr to indicate no target.
C++ - UNIT_-_IV.pptx which contains details about PointersANUSUYA S
Pointer is a variable in C++ that holds the address of another variable. Pointers allow accessing the memory location of other variables. There are different types of pointers based on the data type they are pointing to such as integer, character, class etc. Pointers are declared using an asterisk * before the pointer variable name. The address of a variable can be assigned to a pointer using the & address of operator. Pointers can be used to access members of a class and pass arrays to functions. The this pointer represents the address of the object inside member functions. Virtual functions allow dynamic binding at runtime in inheritance.
- An array is a collection of consecutive memory locations that all have the same name and type. An array allows storing multiple values of the same type using a single name.
- Arrays in C++ must be declared before use, specifying the type, name, and number of elements. Elements are accessed using an index.
- The main advantages of arrays are that they allow storing and processing large numbers of values efficiently using a single name. Arrays also make sorting and searching values easier.
This document provides an overview of an intermediate computer programming course at the University of Gondar in Ethiopia. The course code is CoEng2111 and it is taught by instructor Wondimu B. Topics that will be covered in the course include C++ basics, arrays, strings, functions, and recursion. The course materials are presented over several pages that define concepts, provide code examples, and explain key ideas like variables, data types, operators, and array implementation in C++.
The document discusses pointers in C++. Some key points:
- Pointers store the address of a variable in memory. They can be used to access values indirectly through dereferencing.
- Common pointer operations include address-of (&) and dereference (*) operators.
- Pointers allow passing by reference, reducing code and improving performance when used with arrays, structures, and functions.
- Examples demonstrate declaring and using pointers to swap values without a third variable, and to access array elements indirectly through pointers.
Arrry structure Stacks in data structurelodhran-hayat
There are two types of arrays in C++: single dimensional and multidimensional arrays. The document then provides examples of using single dimensional arrays, traversing arrays using for loops and foreach loops, using structs with constructors and methods, pointers including declaring, assigning, and dereferencing pointers, and dynamic memory allocation using new and delete operators for built-in types, arrays, objects, and multidimensional arrays.
This document discusses arrays in C++. It begins by introducing arrays and their need, then describes the different types of arrays including single, two, and multi-dimensional arrays. It explains how arrays are stored in contiguous memory locations and indexed starting from zero. The document also covers array initialization, unsized array initialization, and using strings as arrays in C++.
This document provides information on arrays, structures, and pointers in C++. It defines an array as a collection of data storage locations that hold the same type of data. Arrays can be one-dimensional or multi-dimensional. Structures are collections of variables of different data types grouped together under a single name. Pointers are variables that store the address of another variable in memory. Pointers can be used to access elements in an array using pointer arithmetic and to dynamically allocate memory using operators like new and delete.
Arrays allow storing multiple values of the same type under one common name. They come in one-dimensional and two-dimensional forms. One-dimensional arrays store elements indexed with a single subscript, while two-dimensional arrays represent matrices with rows and columns indexed by two subscripts. Arrays can be passed to functions by passing their name and size for numeric arrays, or just the name for character/string arrays since strings are null-terminated. Functions can operate on arrays to perform tasks like finding the highest/lowest element or reversing a string.
The document provides information about pointers in C++. It discusses that pointers are variables that store memory addresses and have three main uses: 1) direct access and manipulation of memory locations; 2) support for dynamic memory allocation; and 3) potential improvement of efficiency for certain routines. Pointers can cause crashes if misused. The document then covers key pointer concepts like declaration and initialization of pointers, pointer arithmetic, dynamic memory allocation using new and delete operators, pointers and arrays, pointers and structures, and pointers and constants.
1. C++ arrays allow storing multiple values of the same type in contiguous memory locations accessed via an index. Multidimensional arrays can store arrays of arrays.
2. Pointers store the address of other variables in memory. Pointer variables can be initialized with the address of another variable using the & operator and dereferenced using *.
3. Classes in C++ are user-defined data types that can contain data members and member functions. Class objects can be declared to access members.
- Arrays allow storing multiple values of the same type sequentially in memory. They have a fixed size or dimension.
- To declare an integer array of size 4, we write "int arr[4]". Individual elements can be accessed using indexes from 0 to dimension-1.
- Strings in C++ are arrays of characters that end with a null character. Common string functions like strcpy(), strcat(), strlen() allow manipulating strings.
Pointers in C++ object oriented programmingAhmad177077
Pointers in C++ are variables that store the memory address of another variable. They are powerful tools that allow you to directly access and manipulate memory, making them essential in systems programming, dynamic memory allocation, and data structures.
This document discusses arrays in C++. It defines an array as a collection of variables of the same type referenced by a common name. It describes single dimension arrays as the simplest type where indices start at 0. Two dimensional arrays are arrays where each element is itself an array. Strings can be implemented as single dimension character arrays terminated by a null character. The document discusses initializing arrays, calling functions with arrays, and how the array name acts as a pointer to the first element.
Array In C++ programming object oriented programmingAhmad177077
In C++, an array is a collection of elements of the same data type stored in contiguous memory locations. Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value
This document discusses pointers in C++. It begins by defining a pointer as a variable that holds the memory address of another variable. It then lists three reasons why pointers are one of C++'s most useful features: 1) they allow direct access and manipulation of memory locations, 2) they support dynamic memory allocation, and 3) they can improve efficiency of certain routines. The document goes on to explain pointer declaration, initialization, arithmetic, and how to allocate and free dynamic memory using new and delete operators. It also discusses pointers and strings as well as constant pointers.
The document discusses various operators in C++ including arithmetic, increment/decrement, assignment, relational, logical, and bitwise operators. It also covers topics such as loops, arrays, functions, pointers, classes, and objects. Key operators and concepts covered include addition, subtraction, multiplication, division, increment, decrement, assignment, comparison, logical AND/OR/NOT, bitwise AND/OR/XOR/complement, for/while/do-while loops, one and two dimensional arrays, user-defined and recursive functions, regular and double pointers, dynamic memory allocation, and the basics of classes and objects in C++.
This document provides an overview of various C++ data types including fundamental, derived, and user-defined data types. It discusses integer, character, float, double, and void fundamental data types. It also covers integer, character, and floating-point type modifiers. Additionally, it summarizes arrays, functions, pointers, references, constants, classes, structures, unions, and enumerations as derived or user-defined data types in C++.
This document discusses arrays in C++. It begins by introducing arrays and their need, then describes the different types of arrays including single, two, and multi-dimensional arrays. It explains how arrays are stored in contiguous memory locations and indexed starting from zero. The document also covers array initialization, unsized array initialization, and using strings as arrays in C++.
This document provides information on arrays, structures, and pointers in C++. It defines an array as a collection of data storage locations that hold the same type of data. Arrays can be one-dimensional or multi-dimensional. Structures are collections of variables of different data types grouped together under a single name. Pointers are variables that store the address of another variable in memory. Pointers can be used to access elements in an array using pointer arithmetic and to dynamically allocate memory using operators like new and delete.
Arrays allow storing multiple values of the same type under one common name. They come in one-dimensional and two-dimensional forms. One-dimensional arrays store elements indexed with a single subscript, while two-dimensional arrays represent matrices with rows and columns indexed by two subscripts. Arrays can be passed to functions by passing their name and size for numeric arrays, or just the name for character/string arrays since strings are null-terminated. Functions can operate on arrays to perform tasks like finding the highest/lowest element or reversing a string.
The document provides information about pointers in C++. It discusses that pointers are variables that store memory addresses and have three main uses: 1) direct access and manipulation of memory locations; 2) support for dynamic memory allocation; and 3) potential improvement of efficiency for certain routines. Pointers can cause crashes if misused. The document then covers key pointer concepts like declaration and initialization of pointers, pointer arithmetic, dynamic memory allocation using new and delete operators, pointers and arrays, pointers and structures, and pointers and constants.
1. C++ arrays allow storing multiple values of the same type in contiguous memory locations accessed via an index. Multidimensional arrays can store arrays of arrays.
2. Pointers store the address of other variables in memory. Pointer variables can be initialized with the address of another variable using the & operator and dereferenced using *.
3. Classes in C++ are user-defined data types that can contain data members and member functions. Class objects can be declared to access members.
- Arrays allow storing multiple values of the same type sequentially in memory. They have a fixed size or dimension.
- To declare an integer array of size 4, we write "int arr[4]". Individual elements can be accessed using indexes from 0 to dimension-1.
- Strings in C++ are arrays of characters that end with a null character. Common string functions like strcpy(), strcat(), strlen() allow manipulating strings.
Pointers in C++ object oriented programmingAhmad177077
Pointers in C++ are variables that store the memory address of another variable. They are powerful tools that allow you to directly access and manipulate memory, making them essential in systems programming, dynamic memory allocation, and data structures.
This document discusses arrays in C++. It defines an array as a collection of variables of the same type referenced by a common name. It describes single dimension arrays as the simplest type where indices start at 0. Two dimensional arrays are arrays where each element is itself an array. Strings can be implemented as single dimension character arrays terminated by a null character. The document discusses initializing arrays, calling functions with arrays, and how the array name acts as a pointer to the first element.
Array In C++ programming object oriented programmingAhmad177077
In C++, an array is a collection of elements of the same data type stored in contiguous memory locations. Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value
This document discusses pointers in C++. It begins by defining a pointer as a variable that holds the memory address of another variable. It then lists three reasons why pointers are one of C++'s most useful features: 1) they allow direct access and manipulation of memory locations, 2) they support dynamic memory allocation, and 3) they can improve efficiency of certain routines. The document goes on to explain pointer declaration, initialization, arithmetic, and how to allocate and free dynamic memory using new and delete operators. It also discusses pointers and strings as well as constant pointers.
The document discusses various operators in C++ including arithmetic, increment/decrement, assignment, relational, logical, and bitwise operators. It also covers topics such as loops, arrays, functions, pointers, classes, and objects. Key operators and concepts covered include addition, subtraction, multiplication, division, increment, decrement, assignment, comparison, logical AND/OR/NOT, bitwise AND/OR/XOR/complement, for/while/do-while loops, one and two dimensional arrays, user-defined and recursive functions, regular and double pointers, dynamic memory allocation, and the basics of classes and objects in C++.
This document provides an overview of various C++ data types including fundamental, derived, and user-defined data types. It discusses integer, character, float, double, and void fundamental data types. It also covers integer, character, and floating-point type modifiers. Additionally, it summarizes arrays, functions, pointers, references, constants, classes, structures, unions, and enumerations as derived or user-defined data types in C++.
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdfVarsha Nayak
In recent years, organizations have increasingly sought robust open source alternative to Jasper Reports as the landscape of open-source reporting tools rapidly evolves. While Jaspersoft has been a longstanding choice for generating complex business intelligence and analytics reports, factors such as licensing changes and growing demands for flexibility have prompted many businesses to explore other options. Among the most notable alternatives to Jaspersoft, Helical Insight stands out for its powerful open-source architecture, intuitive analytics, and dynamic dashboard capabilities. Designed to be both flexible and budget-friendly, Helical Insight empowers users with advanced features—such as in-memory reporting, extensive data source integration, and customizable visualizations—making it an ideal solution for organizations seeking a modern, scalable reporting platform. This article explores the future of open-source reporting and highlights why Helical Insight and other emerging tools are redefining the standards for business intelligence solutions.
Simplify Training with an Online Induction Portal for ContractorsSHEQ Network Limited
Enhance safety and compliance with our online induction portal, designed for efficient online induction and contractor onboarding processes. Contact us on +353 214536034.
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchMaxim Salnikov
Discover how Agentic Retrieval in Azure AI Search takes Retrieval-Augmented Generation (RAG) to the next level by intelligently breaking down complex queries, leveraging full conversation history, and executing parallel searches through a new LLM-powered query planner. This session introduces a cutting-edge approach that delivers significantly more accurate, relevant, and grounded answers—unlocking new capabilities for building smarter, more responsive generative AI applications.
Traditional Retrieval-Augmented Generation (RAG) pipelines work well for simple queries—but when users ask complex, multi-part questions or refer to previous conversation history, they often fall short. That’s where Agentic Retrieval comes in: a game-changing advancement in Azure AI Search that brings LLM-powered reasoning directly into the retrieval layer.
This session unveils how agentic techniques elevate your RAG-based applications by introducing intelligent query planning, subquery decomposition, parallel execution, and result merging—all orchestrated by a new Knowledge Agent. You’ll learn how this approach significantly boosts relevance, groundedness, and answer quality, especially for sophisticated enterprise use cases.
Key takeaways:
- Understand the evolution from keyword and vector search to agentic query orchestration
- See how full conversation context improves retrieval accuracy
- Explore measurable improvements in answer relevance and completeness (up to 40% gains!)
- Get hands-on guidance on integrating Agentic Retrieval with Azure AI Foundry and SDKs
- Discover how to build scalable, AI-first applications powered by this new paradigm
Whether you're building intelligent copilots, enterprise Q&A bots, or AI-driven search solutions, this session will equip you with the tools and patterns to push beyond traditional RAG.
How to Generate Financial Statements in QuickBooks Like a Pro (1).pdfQuickBooks Training
Are you preparing your budget for the next year, applying for a business credit card or loan, or opening a company bank account? If so, you may find QuickBooks financial statements to be a very useful tool.
These statements offer a brief, well-structured overview of your company’s finances, facilitating goal-setting and money management.
Don’t worry if you’re not knowledgeable about QuickBooks financial statements. These statements are complete reports from QuickBooks that provide an overview of your company’s financial procedures.
They thoroughly view your financial situation by including important features: income, expenses, investments, and disadvantages. QuickBooks financial statements facilitate your financial management and assist you in making wise determinations, regardless of your experience as a business owner.
Scaling FME Flow on Demand with Kubernetes: A Case Study At Cadac Group SaaS ...Safe Software
In today’s data-driven world, efficiency is key. For Cadac, a Dutch leading provider of SaaS solutions and Autodesk Platinum partner, ensuring that customers can process data on demand is crucial to delivering a seamless experience. However, with fluctuating user demand, a challenge emerged: How do we scale FME Flow to meet on-the-fly processing needs without over-investing in infrastructure? Enter Kubernetes and KEDA (Kubernetes Event-Driven Autoscaling). In this presentation, we will explore how these cutting-edge technologies helped dynamically scale FME Flow engines based on real-time demand, without wasting resources. Instead of relying on the standard Kubernetes autoscaling based on CPU and RAM metrics, which can lead to ineffective scaling, KEDA can integrate directly with the FME Flow REST API. This allowed autoscaling based on the actual number and type of jobs in the queue. Now, whenever demand spikes, Kubernetes automatically spins up additional machines tailored to the type of workload—whether it’s CPU-intensive tasks or memory-heavy processes—ensuring optimal performance and cost-efficiency. While afterwards also autoscaling to zero, to reduce costs. Join us as we dive into how this approach helped Cadac scale on demand, reduce infrastructure costs, and provide a better experience for their customers. This session will feature both a technical walkthrough and insights on the real-world impact and value this solution has delivered to their platform and client.
14 Years of Developing nCine - An Open Source 2D Game FrameworkAngelo Theodorou
A 14-year journey developing nCine, an open-source 2D game framework.
This talk covers its origins, the challenges of staying motivated over the long term, and the hurdles of open-sourcing a personal project while working in the game industry.
Along the way, it’s packed with juicy technical pills to whet the appetite of the most curious developers.
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...WSO2
Enterprises must deliver intelligent, cloud native applications quickly—without compromising governance or scalability. This session explores how an internal developer platform increases productivity via AI for code and accelerates AI-native app delivery via code for AI. Learn practical techniques for embedding AI in the software lifecycle, automating governance with AI agents, and applying a cell-based architecture for modularity and scalability. Real-world examples and proven patterns will illustrate how to simplify delivery, enhance developer productivity, and drive measurable outcomes.
Learn more: https://wso2.com/choreo
Generative Artificial Intelligence and its ApplicationsSandeepKS52
The exploration of generative AI begins with an overview of its fundamental concepts, highlighting how these technologies create new content and ideas by learning from existing data. Following this, the focus shifts to the processes involved in training and fine-tuning models, which are essential for enhancing their performance and ensuring they meet specific needs. Finally, the importance of responsible AI practices is emphasized, addressing ethical considerations and the impact of AI on society, which are crucial for developing systems that are not only effective but also beneficial and fair.
Key AI Technologies Used by Indian Artificial Intelligence CompaniesMypcot Infotech
Indian tech firms are rapidly adopting advanced tools like machine learning, natural language processing, and computer vision to drive innovation. These key AI technologies enable smarter automation, data analysis, and decision-making. Leading developments are shaping the future of digital transformation among top artificial intelligence companies in India.
For more information please visit here https://www.mypcot.com/artificial-intelligence
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...Insurance Tech Services
A modern Policy Administration System streamlines workflows and integrates with core systems to boost speed, accuracy, and customer satisfaction across the policy lifecycle. Visit https://www.damcogroup.com/insurance/policy-administration-systems for more details!
Eliminate the complexities of Event-Driven Architecture with Domain-Driven De...SheenBrisals
The distributed nature of modern applications and their architectures brings a great level of complexity to engineering teams. Though API contracts, asynchronous communication patterns, and event-driven architecture offer assistance, not all enterprise teams fully utilize them. While adopting cloud and modern technologies, teams are often hurried to produce outcomes without spending time in upfront thinking. This leads to building tangled applications and distributed monoliths. For those organizations, it is hard to recover from such costly mistakes.
In this talk, Sheen will explain how enterprises should decompose by starting at the organizational level, applying Domain-Driven Design, and distilling to a level where teams can operate within a boundary, ownership, and autonomy. He will provide organizational, team, and design patterns and practices to make the best use of event-driven architecture by understanding the types of events, event structure, and design choices to keep the domain model pure by guarding against corruption and complexity.
Explore the professional resume of Pramod Kumar, a skilled iOS developer with extensive experience in Swift, SwiftUI, and mobile app development. This portfolio highlights key projects, technical skills, and achievements in app design and development, showcasing expertise in creating intuitive, high-performance iOS applications. Ideal for recruiters and tech managers seeking a talented iOS engineer for their team.
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesMarjukka Niinioja
Teams delivering API are challenges with:
- Connecting APIs to business strategy
- Measuring API success (audit & lifecycle metrics)
- Partner/Ecosystem onboarding
- Consistent documentation, security, and publishing
🧠 The big takeaway?
Many teams can build APIs. But few connect them to value, visibility, and long-term improvement.
That’s why the APIOps Cycles method helps teams:
📍 Start where the pain is (one “metro station” at a time)
📈 Scale success across strategy, platform, and operations
🛠 Use collaborative canvases to get buy-in and visibility
Want to try it and learn more?
- Follow APIOps Cycles in LinkedIn
- Visit the www.apiopscycles.com site
- Subscribe to email list
-
Content Mate Web App Triples Content Managers‘ ProductivityAlex Vladimirovich
Content Mate is a web application that consolidates dozens of fragmented operations into a single interface. The input is a list of product SKUs, and the output is an archive containing processed images, PDF documents, and spreadsheets with product names, descriptions, attributes, and key features—ready for bulk upload.
2. WHAT IS ARRAY?
• An array is a group of consective memory
locations with same name and data type.
• Simple variable is a single memory location with
unique name and a type. But an Array is
collection of different adjacent memory
locations. All these memory locations have one
collective name and type.
• The memory locations in the array are known as
elements of array. The total number of elements
in the array is called length.
• The elements of array is accessed with
reference to its position in array, that is call
index or subscript.
3. DECLARATION OF AN ARRAY:
Like a regular variable, an array must be declared
before it is used. A typical declaration for an array in
Visual C++ is:
type name [elements];
type is a valid type (like int, float...)
name is a valid identifier
elements field (which is always enclosed in square
brackets []), specifies how many of these elements
the array has to contain.
5. ADVANTAGES OF ARRAY:
Arrays can store a large number of value
with single name.
Arrays are used to process many value
easily and quickly.
The values stored in an array can be
sorted easily.
The search process can be applied on
arrays easily.
8. ONE DIMENSIONAL ARRAY:
A one dimensional array is one in which one
subscript /indices specification is needed to
specify a particular element of array
Declaration :
Data_type array_name [size of array ];
Eg:
Int num[10];
10. MEMORY REPRESENTATION:
num[0] num[1] num[2] num[3] num[4] num[5] num[6] num[7] num[8] num[9]
2000 2002 2004 2006 2008 2010 2012 2014 2016 2018
starting Address of location
Total memory in bytes that an array is occupied :
Size of array=size of array*size of(base type)
Hear,
10*2=20
39 56 23 98 6 56 9 2 54 67
11. TWO DIMENSIONAL ARRAY:
A 2-d array is an array in which each element is
itself an array
i.e int num[4][3]
0 1 2
0
1
2
3
No of
rows
No
of
colu
mns
No of element in
2-D array =M*N
Num [2][1]
13. MEMORY REPRESENTATION:
Total bytes= no of rows*no of columns*size of(base type)
Memory reprsentation in 2-D array:
char A [2][3]
A[0][0] A[0][1] A[0][2] A[1][0] A[1][1] A[1][2]
5001 5002 5003 5004 5005 5006
14. MULTI DIMENSIONAL ARRAY:
An array with dimensions more than
two .The maximum limit of array is compiler
dependent
Declaration:
Data_type name [a][b][c][d][e][f]…….[n];
Array of 3 or more dimensional are not often
use because of huge memory requirement
and complexity involved
16. ARRAY INITIALIZATION:
C++ provides the facility of array initialization at the time of
declaration .General form of array initialization is as:
Type array_name[size 1]…..[size N] ={vale list};
Eg:
Int days_month[12]={31,25,29,03,31,19,20,31,18,20,31,29};
Char string[6]={‘a’,’r’,’g’,’y’,’d’,’0’};
2-D array are also initialized in same way as linear array
Int cube[4][2]={ 1,3,
4,6,
9,37,
5,78
};
17. UNSIZED ARRAY INITIALIZATION:
C++ allowed you to skip the size of array in an array initialization
statement C++ automatically create an array big enough to hold all
the initializers present
Char S1[] =“ first string ”;
you skip the size, you must give list of initializers so that C++ can
calculate the size of array
Int val []={3,5,6,2,8,9,6,4};
Int cube [] [2] ={ 1,3,
67,7,
6,87,
};
18. STRING AS ARRAY:
C++ does not have a String data type ,it
impairments string as 1-D character Arrray .A
string as a character array is terminate by a
null character ‘0’
Char str 1 [11];
Char square [][]={ ‘first string’,
‘second string’,
‘third string’
};
19. SORTING ARRAYS:
Sorting is a process of arranging
the value of array in a particular
order. An array can be sorted in
two order.
o Ascending Order
o Descending Order
21. String
C++ strings are sequences of characters stored in a char
array.
Strings are used to store words and text.
String index starts with o last character of string in
null(0)
Strings in C++ can be defined either using
the std::string class or the C-style character arrays.
22. C Style Strings
These strings are stored as the plain old array of
characters terminated by a null character ‘0’. They
are the type of strings that C++ inherited from C
language.
Syntax:
Char str[]=“greeksforgreeks”
23. // C++ Program to demonstrate strings
#include <iostream>
using namespace std;
int main()
{
char s[] = "GeeksforGeeks";
cout << s << endl;
return 0;
}
Output:GreeksforGreeks
24. std::string Class
These are the new types of strings that are introduced
in C++ as std::string class defined inside <string> header
file. This provides many advantages over conventional
C-style strings such as dynamic size, member functions,
etc.
Syntax:std::string str("GeeksforGeeks");
25. String manipulator functions
C++ supports a wide range of functions that
manipulate null-terminated strings. These are:
strcpy(str1, str2): Copies string str2 into string
str1.
strcat(str1, str2): Concatenates string str2 onto
the end of string str1.
strlen(str1): Returns the length of string str1.
strcmp(str1, str2): Returns 0 if str1 and str2 are
the same; less than 0 if str1<str2; greater than 0 if
str1>str2.
strchr(str1, ch): Returns a pointer to the first
occurrence of character ch in string str1.
strstr(str1, str2): Returns a pointer to the first
occurrence of string str2 in string str1.
26. Pointer
Pointer is a variable that holds the memory address of
another variable.
Declaration of array is
datataype *pointer-variable;
Pointer variable is the name of the pointer, datatype
refers to valid c++ datatypes.
27. Int *ptr,a; //declaration
Ptr=&a; //initialization
Ptr contains address of variabler a,& is addess operator
or reference operator to retrieve the address of the
variable.
Example int a=10;
int *ptr=&a;
28. Pointer arithmetic
Pointer arithmetic means performing arithmetic
operations on pointers. It refers to the operations that
are valid to perform on pointers. Following are the
arithmetic operations valid on pointers in C++:
Incrementing and Decrementing Pointers
Addition of Constant to Pointers
Subtraction of Constant from Pointers
Subtraction of Two Pointers of the Same Type
Comparison of Pointers
29. Incrementing and Decrementing Pointer in C++
Incrementing or decrementing a pointer will make it
refer to the address of the next or previous data in the
memory. This process differs from incrementing and
decrementing numeric data.
30. Incrementing a Pointer
Incrementing a pointer will depend on the type of
variable address stored in the pointer. If the pointer
stored the address of the integer type variable then the
size of the integer pointer can be 4 bytes.
For example, If a pointer holds the address 1000 and
we increment the pointer, then the pointer will be
incremented by 4 or 8 bytes (size of the integer), and
the pointer will now hold the address 1004.
31. Decrementing a Pointer
When we apply a decrement operation on the pointer
then the pointer is decremented by 4 or 8 bytes
depending upon the machine.
For example, If a pointer holds the address 1004 and
we decrement the pointer, then the pointer will be
decremented by 4 or 8 bytes (size of the integer), and
the pointer will now hold the address 1000.
33. Addition of Constant to Pointers
We can add integer values to Pointers and the pointer is
adjusted based on the size of the data type it points to.
For example, if an integer pointer stores the address
1000 and we add the value 5 to the pointer, it will store
the new address as:
35. Subtraction of Constant from Pointers
We can also subtract a constant from Pointers and it is
the same as the addition of a constant to a pointer. For
example, if an integer pointer stores the address 1000
and we subtract the value 5 from the pointer, it will
store the new address as:
1000 - (5 * 4(size of an integer)) = 980
36. Subtraction of Two Pointers of the Same Datatype
The Subtraction of two pointers can be done only when
both pointers are of the same data type. The
subtraction of two pointers gives the number of
elements present between the two pointers
37. Comparison of Pointers
In C++, we can perform a comparison between the two
pointers using the relational operators(>, <, >=, <=, ==,
!=). We generally use this operation to check whether
the two-pointer as pointing to the same memory
location or not.