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 ".
If any class have multiple functions with same names but different parameters then they are said to be overloaded. Function overloading allows you to use the same name for different functions, to perform, either same or different functions in the same class.
If you have to perform one single operation but with different number or types of arguments, then you can simply overload the function.
If any class have multiple functions with same names but different parameters then they are said to be overloaded. Function overloading allows you to use the same name for different functions, to perform, either same or different functions in the same class.
If you have to perform one single operation but with different number or types of arguments, then you can simply overload the function.
At the end of this lecture students should be able to;
Define the C pointers and its usage in computer programming.
Describe pointer declaration and initialization.
Apply C pointers for expressions.
Experiment on pointer operations.
Identify NULL pointer concept.
Experiment on pointer to pointer, pointer arrays, arrays with pointers and functions with pointers.
Apply taught concepts for writing programs.
03 of 03 parts
Get Part 1 from https://www.slideshare.net/ArunUmrao/notes-for-c-programming-for-bca-mca-b-sc-msc-be-amp-btech-1st-year-1
Get Part 2 from https://www.slideshare.net/ArunUmrao/notes-for-c-programming-for-bca-mca-b-sc-msc-be-amp-btech-1st-year-2
C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, while a static type system prevents unintended operations. C provides constructs that map efficiently to typical machine instructions and has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computers, from supercomputers to PLCs and embedded system.
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...ssuserd6b1fd
C programming language notes for beginners and Collage students. Written for beginners. Colored graphics. Function by Function explanation with complete examples. Well commented examples. Illustrations are made available for data dealing at memory level.
The primary focus of the PPT is to develop the initial skill of using HTML & CSS programming language to develop a static web page like Portfolio.
This PowerPoint Presentation is of Front End Design.
This PPT will give an entire view on developing the static web page.
This PPT covers the entire topic of Macro Assembler. This Includes the topic such as design of a macro assembler, 3 passes of macro assembler etc.
This is the PPT of System Programming.
This is an PPT about the Icons that are used in Graphical User Interface, the Images that are used for developing a web page & the use of multimedia for various purpose.
This is an PowerPoint Presentation of Front End Design.
This PPT describes about the "Project Tracking" activity & statistical process control at Infosys.
It covers the entire topic such as project tracking, activities tracking, defect tracking, issue tracking, etc.
It covers all main activity of SPC such as SPC analysis, control chart for SPC etc.
This PowerPoint presentation is of "Software Project Management".
This is the PowerPoint presentation on the topic "Peephole Optimization". This presentation covers the entire topic of peephole optimization.
This PowerPoint presentation is of Compiler Design.
This is the PPT of "Routing in Manet". It covers the entire topic of routing protocol.
This PowerPoint presentation is of Data Communication & Computer Network.
Secant method in Numerical & Statistical MethodMeghaj Mallick
This is an PPT of a Mathematical Paper i.e Numerical & Statistical Method. It contsin the following topic such as "Secant method in Numerical & Statistical Method ".
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Orkestra
UIIN Conference, Madrid, 27-29 May 2024
James Wilson, Orkestra and Deusto Business School
Emily Wise, Lund University
Madeline Smith, The Glasgow School of Art
Acorn Recovery: Restore IT infra within minutesIP ServerOne
Introducing Acorn Recovery as a Service, a simple, fast, and secure managed disaster recovery (DRaaS) by IP ServerOne. A DR solution that helps restore your IT infra within minutes.
This presentation by Morris Kleiner (University of Minnesota), was made during the discussion “Competition and Regulation in Professions and Occupations” held at the Working Party No. 2 on Competition and Regulation on 10 June 2024. More papers and presentations on the topic can be found out at oe.cd/crps.
This presentation was uploaded with the author’s consent.
Have you ever wondered how search works while visiting an e-commerce site, internal website, or searching through other types of online resources? Look no further than this informative session on the ways that taxonomies help end-users navigate the internet! Hear from taxonomists and other information professionals who have first-hand experience creating and working with taxonomies that aid in navigation, search, and discovery across a range of disciplines.
0x01 - Newton's Third Law: Static vs. Dynamic AbusersOWASP Beja
f you offer a service on the web, odds are that someone will abuse it. Be it an API, a SaaS, a PaaS, or even a static website, someone somewhere will try to figure out a way to use it to their own needs. In this talk we'll compare measures that are effective against static attackers and how to battle a dynamic attacker who adapts to your counter-measures.
About the Speaker
===============
Diogo Sousa, Engineering Manager @ Canonical
An opinionated individual with an interest in cryptography and its intersection with secure software development.
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
Dynamic Objects,Pointer to function,Array & Pointer,Character String Processing
1. ‘ Dynamic objects, pointer to function, array
and pointers, character string processing ’
Presented By:
Muskaan (MCA/25020/18)
Prashi Jain (MCA/25022/18)
2. DYNAMIC OBJECTS
C++ supports dynamic memory allocation and deallocation . C++
allocates memory and initializes the member variables.
An object can be created at run-time ; such an object is called a
dynamic object.
The new and delete operators are used to allocate and
deallocate memory to such objects.
3. NEW Operator
The new operator is used to allocate memory at runtime.
The memory is allocated in bytes.
Syntax:
DATA TYPE *ptr = new DATA TYPE;
// Pointer initialized with NULL
// Then request memory for the variable
int *p = NULL;
p = new int;
OR
// Combine declaration of pointer
// and their assignment
int *p = new int;
4. We can initialize a variable while dynamical allocation in the
following way:
int *ptr = new int (4);
Example:
#include<iostream.h>
#include<conio.h>
int main()
{
int *ptr = new int;
*ptr = 4;
cout << *ptr << endl ;
return 0;
}
OUTPUT: 4
5. DELETE Operator
A dynamic object can be distroyed by using the DELETE
operator
Syntax :
delete ptr;
Here ptr is the pointer to the dynamically allocated
variable
The delete operator simply returns the memory allocated
back to the operating system so that it can be used again.
6. Let’s look at an example:
int main()
{
int *ptr = new int;
*ptr = 4;
cout << *ptr << endl;
delete ptr;
return 0;
}
OUTPUT: 4
7. ADVANTAGES:
The main advantage of using dynamic memory allocation
is preventing the wastage of memory.
We can allocate (create) additional storage whenever we
need them.
We can de-allocate (free/delete) dynamic space whenever
we are done with them
8. POINTER TO FUNCTION
C++ allows you to pass a pointer to a function.
Simply declare the function parameter as a pointer type.
Syntax:
data type fun_name(data type *arg)
9. Let’s look at an example:
#include <iostream.h>
void swap( int *a, int *b )
{
int t;
t = *a;
*a = *b;
*b = t;
}
int main()
{
int num1, num2;
cout << "Enter first number" << endl;
cin >> num1;
cout << "Enter second number" << endl;
cin >> num2;
swap( &num1, &num2);
cout << "First number = " << num1 << endl;
cout << "Second number = " << num2 << endl;
return 0;
}
12. Array
An array is collection of items stored at
continues memory locations.
Syntax : Int arr[10]; //Array declaration by
specifying size
13. Pointers
A pointer is a variable whose value is the
address of another variable. Like any variable or
constant.
Syntax : type * var_name; //declaration of an
pointer
Example: int *p,a;
p=&a;
14. Arrays and pointers
Arrays and pointers are very closely related in c++.
For Example: An array declared as
Int a[10]
Can also be accessed using its pointers representation . The
name of the array is a constant pointer to the first element of the
array. So a can be considered as const int*.
Here arr points to the
first element of the array
15. For example:
In array and pointers ptr[i] and*(ptr+i) are considered as same.
Int a[4]={10,20,30,40};
Int *ptr = a;
for(int i =0 ; i<4; i++)
{
cout<< *(ptr+i) <<endl;
}
Output: 10
20
30
40
16. For the same array
For(int i=0 ; i<4;i++)
{
Cout<< ptr[i] <<endl;
}
Output:
10
20
30
40
17. Character string processing
String:
In C++, the one-dimensional array of characters
are called strings, which is terminated by a null
character 0.
Syntax: char greeting[6];
18. What is character string processing?
Character string processing basically means
accessing (insertion and extraction operators)
the characters from a string.
C++ provides following two types of string
representations −
• The C-style character string.
• The string class type introduced with Standard
C++.
19. Insertion operator : The result of inserting a char pointer to
an output stream is same as displaying a char array whose
first element is located at the address to which the char*
object points.
Example: Char text[9]= “world”;
For(char *ptr = text; *ptr!= ‘0’ ; ++ptr)
{ Cout<< ptr << endl;
}
Output : world
orld
rld
ld
d
20. Extraction operator
When the right operand of an extraction operator is a char*
object, the behaves same as extraction from char array- by
default leading white space is skipped and the next
nonwhitespace string of characters is extracted.
For example: char str[40];
Cout<<“enter a string:” ;
Cin>> str;
Cout<<“you entered :” <<str <<endl;
}
Output : enter a string : programming is fun
you entered: programming
21. String functions
1- strlen(): returns the length of the sytring.
Syntax: int strlen(s1);
2- strcpy(): copies one string to another string.
Syntax: char *strcpy(s1 , s2);
3- strcat(): this function concates two strings.
syntax: char *strcat(s1 , s2 );
4- strcmp(): compares two strings.
syntax: strcmp(s1 ,s2);