SlideShare a Scribd company logo
Structured Programming using C
Unit VI
Pointer
Contents
Pointers
6.1 Introduction, Definition and uses of Pointers, Address Operator, Pointer Variables
6.2 Pointer Arithmetic
6.3 Call by value, call by Reference
R.C.Patel Information of Technology,Shirpur
Introduction
• The pointer in C language is a variable which stores the address of another
variable.
• The size of the pointer depends on the architecture. (32-bit architecture the
size of a pointer is 2 byte).
• Every variable stored at a specific memory location and every memory
location has its address.
• The address can be accessed using ampersand (&) operator.
R.C.Patel Information of Technology,Shirpur
Introduction
#include <stdio.h>
int main() {
int var1;
char var2[10];
printf("Address of var1 variable: %xn",&var1); // Print the memory address of the integer variable var1
printf("Address of var2 variable: %xn",&var2); // Print the memory address of the character array var2
return 0;
}
the format specifier %x is used to display hexadecimal integers in lowercase(unsigned integer)
Whenever a variable is declared in a program, system allocates a location i.e an address to
that variable in the memory, to hold the assigned value.
This location has its own address number.
Let us assume that system has allocated memory location 80F for a variable a.
We can access the value 10 either by using the variable name a or by using its address 80F.
Concept of Pointer
Advantages of Pointers
• Pointers in C programming are helpful to access a memory location
• Pointers are an effective way to access the array structure elements
• Pointers are used for the allocation of dynamic memory and the distribution
• Pointers are used to build complicated data structures like a linked list, graph, tree, etc
R.C.Patel Information of Technology,Shirpur
Usage of Pointers
• For passing the argument by using references.
• For accessing the elements of an array.
• For dynamic memory allocation by using malloc() and calloc() functions .
• Used in arrays, functions to improve the performance of code.
• Implementing a data structure.
• For doing system-level programming.
UNIT 6structureofcprogrammingforppt.pptx
UNIT 6structureofcprogrammingforppt.pptx
UNIT 6structureofcprogrammingforppt.pptx
R.C.Patel Information of Technology,Shirpur
Null Pointer Example
#include <stdio.h>
int main() {
int *p = NULL; // Initialize the pointer as NULL.
printf("The value of the pointer is: %un", p); // Use %p to display pointer value.
return 0;
}
The format specifier %u is used to print unsigned integer values
UNIT 6structureofcprogrammingforppt.pptx
R.C.Patel Information of Technology,Shirpur
#include<stdio.h>
int main(){
int number=50; // Declare an integer variable 'number' and initialize it with the value 50
int *p; // Declare a pointer variable 'p' of type int
p=&number; //stores the address of number variable
printf("Address of p variable is %x n",p); / Print the address stored in the pointer 'p'
printf("Value of p variable is %d n",*p); // Dereference the pointer 'p' to access the value stored at the
address it points to
return 0;
}
UNIT 6structureofcprogrammingforppt.pptx
R.C.Patel Information of Technology,Shirpur
Pointer Program to swap two numbers without using the 3rd variable.
#include<stdio.h>
int main(){
int a=10,b=20; // Declare and initialize two integer variables 'a' and 'b'.
int *p1=&a,*p2=&b; // Declare two pointers 'p1' and 'p2' pointing to 'a' and 'b', respectively.
// Print the initial values of 'a' and 'b' using dereferenced pointers.
printf("Before swap: *p1=%d *p2=%d",*p1,*p2);
*p1=*p1+*p2; // Step 1: Add the values pointed to by 'p1' and 'p2' and store the sum in *p1.
*p2=*p1-*p2; // Step 2: Subtract the new value of *p1 by *p2 to get the original value of *p1,
and store it in *p2.
*p1=*p1-*p2; // Step 3: Subtract the new value of *p2 from *p1 to get the original value of *p2,
and store it in *p1.
printf("nAfter swap: *p1=%d *p2=%d",*p1,*p2);
// Print the swapped values of 'a' and 'b' using dereferenced pointers
return 0;
}
Output
Before swap:
*p1=10 *p2=20
After swap:
*p1=20 *p2=10
R.C.Patel Information of Technology,Shirpur
Pointer Arithmetic in C
We can perform arithmetic operations on the pointers like addition, subtraction, etc.
Following arithmetic operations are possible on the pointer in C language:
• Increment
• Decrement
• Addition
• Subtraction
• Comparison
R.C.Patel Information of Technology,Shirpur
Example of incrementing pointer variable on 64-bit architecture.
#include<stdio.h>
int main(){
int number=50;
int *p; // Declare a pointer variable 'p' of type int
p=&number; // Assign the address of the variable 'number' to the pointer 'p'
printf("Address of p variable is %u n",p); // Print the address stored in the pointer 'p' (the address of 'number')
p=p+1; // Increment the pointer 'p' by 1. This moves the pointer to the next memory location based on the size of the data type (int in this
case, which is typically 4 bytes)
// Print the updated address stored in 'p' after incrementing
printf("After increment: Address of p variable is %u n",p); // in our case, p will get incremented by 4 bytes.
return 0; // %u format specifier is used to print unsigned decimal integers
}
R.C.Patel Information of Technology,Shirpur
Traversing an array by using pointer
#include<stdio.h>
void main ()
{
int arr[5] = {1, 2, 3, 4, 5}; // Declare and initialize an integer array 'arr' with 5 elements
int *p = arr; // Declare a pointer 'p' and initialize it with the base address of the array 'arr'
int i; // Declare a loop variable 'i’
// Print a message indicating that the array elements will be printed
printf("printing array elements...n");
for(i = 0; i< 5; i++) // Loop through each element of the array
{// Use pointer arithmetic to access the array elements and print their values
printf("%d ",*(p+i));
}
}
Pointer to Array
// Comparing both the strings using pointers
int stringcompare(char *a,char *b)
{
int flag=0; // Loop through both strings until
one of them reaches the null character ('0')
while(*a!='0' && *b!='0') // while loop
{
if(*a!=*b) // Compare the characters at the
current position
{
flag=1; // Set the flag to 1 if the characters
are not equal
}
a++; // Move the pointer `a` to the next
character
b++; // Move the pointer `b` to the next
character
}
if(flag==0) // If the flag is still 0, the strings are
equal; otherwise, they are not
return 0;
else
return 1;
}
#include <stdio.h> //accepts two arguments pointer to a character
int stringcompare(char*,char*); // Function to compare two strings using pointers
int main()
{
char str1[20]; // Declaration of a character array to store the first string
char str2[20]; // Declaration of a character array to store the second string
printf("Enter the first string : ");
scanf("%s",str1);
printf("nEnter the second string : ");
scanf("%s",str2);
int compare=stringcompare(str1,str2); // Call the `stringcompare()`
function to compare the two strings if(compare==0)
printf("strings are equal");
else
printf("strings are not equal");
return 0;
}
Call by Value
#include <stdio.h>
// Function prototype for call-by-value
void swap(int a, int b); //takes two arguments
int main()
{
int a = 10; // Initialize variable a
int b = 20; // Initialize variable b
// Display initial values of a and b in main
printf("nBefore swapping the values in mainn a = %d, b = %d", a, b);
// Call swap function (call-by-value)
swap(a, b);
// Display values of a and b in main after swap (no change expected)
printf("nAfter swapping values in mainn a = %d, b = %dn", a, b);
return 0; // Exit the program
}
// Function to swap two numbers using call-by-value
void swap(int a, int b)
{
printf("nInside the swap function (Call By Value)");
int temp; // Temporary variable to hold one value during swap
temp = a;
a = b;
b = temp;
// Display swapped values inside the function
printf("nAfter swapping in functionn a = %d, b = %dn", a, b);
// Changes will not affect the variables in the main function
}
R.C.Patel Information of Technology,Shirpur
Call by Reference // Function to swap two numbers using call-by-reference
void swap1(int *a, int *b)
{
printf("n Swapping inside function using Call By Reference");
int temp; // Temporary variable to hold one value during swap
temp = *a; // Dereference pointer a to get its value
*a = *b; // Dereference pointer b to assign its value to a
*b = temp; // Assign temp value (initial value of a) to b
// Display swapped values inside the function
printf("n After swapping in function: n a = %d, b = %d", *a,
*b);
}
#include <stdio.h>
// Function prototype for call-by-reference
void swap1(int *, int *); function accepts pointers to integers as its
arguments.
int main()
{
int a = 10; // Initialize variable a
int b = 20; // Initialize variable b
// Display initial values of a and b in main
printf("n Before swapping in main: n a = %d, b = %d", a, b);
// Call swap1 function (call-by-reference)
swap1(&a, &b);
// Display values of a and b in main after swap
printf("n After swapping in main: n a = %d, b = %d", a, b);
return 0; // Indicate successful program termination
}
R.C.Patel Information of Technology,Shirpur
Call by value and call by Reference
#include <stdio.h>
// Function prototypes
void swap(int, int); // Function prototype for call-by-value
void swap1(int *, int *); // Function prototype for call-by-reference
int main()
{
int a = 10; // Initialize variable a
int b = 20; // Initialize variable b
// Display initial values of a and b in main
printf("n Before swapping the values in main n a = %d, b = %d", a, b);
// Call swap function (call-by-value)
swap(a, b);
// Display values of a and b in main after swap (no change expected)
printf("n After swapping values in main n a = %d, b = %d", a, b);
printf("n *********************************************** ");
// Display values of a and b before calling swap1
printf("n Before swapping the values in main n a = %d, b = %d", a, b);
R.C.Patel Information of Technology,Shirpur
// Call swap1 function (call-by-reference)
swap1(&a, &b);
// Display values of a and b in main after swap1 (change expected)
printf("n After swapping values in main n a = %d, b = %d", a, b);
printf("n *********************************************** ");
return 0;
}
// Function to swap two numbers using call-by-value
void swap(int a, int b)
{
printf("n Output Using Call By Value");
int temp; // Temporary variable to hold one value during swap
temp = a;
a = b;
b = temp;
// Display swapped values inside the function
printf("n After swapping values in function n a = %d, b = %d", a, b);
// Here, the changes will not affect the actual variables in main
}
// Function to swap two numbers using call-by-reference
void swap1(int *a, int *b)
{
printf("n Output Using Call By Reference");
int temp; // Temporary variable to hold one value during swap
temp = *a;
*a = *b;
*b = temp;
// Display swapped values inside the function
printf("n After swapping values in function n a = %d, b = %d", *a,
*b);
// Here, the changes will reflect in the actual variables in main
}
R.C.Patel Information of Technology,Shirpur

More Related Content

PPTX
UNIT 4 POINTERS.pptx pointers pptx for basic c language
PPTX
Pointers in C Language
PPTX
pointers.pptx
PPT
l7-pointers.ppt
PPT
Pointers C programming
PPTX
unit-7 Pointerdesfsdfsdgsdgaa notes.pptx
PDF
9. pointer, pointer & function
PPTX
2-Concept of Pointers in c programming.pptx
UNIT 4 POINTERS.pptx pointers pptx for basic c language
Pointers in C Language
pointers.pptx
l7-pointers.ppt
Pointers C programming
unit-7 Pointerdesfsdfsdgsdgaa notes.pptx
9. pointer, pointer & function
2-Concept of Pointers in c programming.pptx

Similar to UNIT 6structureofcprogrammingforppt.pptx (20)

PPT
ch08.ppt
PDF
[ITP - Lecture 13] Introduction to Pointers
PPTX
chapter-7 slide.pptx
PPT
presentation_pointers_1444076066_140676 (1).ppt
PPT
c program.ppt
PPT
pointers CP Lecture.ppt
PPTX
Algoritmos e Estruturas de Dados - Pointers
PPTX
Unit-4-1.pptxjtjrjfjfjfjfjfjfjfjrjrjrjrjejejeje
PDF
Lk module5 pointers
PDF
Chapter 13.1.8
PDF
PSPC--UNIT-5.pdf
PPTX
PDF
Pointers [compatibility mode]
PDF
Pointers and call by value, reference, address in C
PPTX
Introduction to c
PPTX
C Programming Unit-4
PDF
The best every notes on c language is here check it out
PDF
Lec21-CS110 Computational Engineering
PPTX
Pointers
PPTX
Pointers
ch08.ppt
[ITP - Lecture 13] Introduction to Pointers
chapter-7 slide.pptx
presentation_pointers_1444076066_140676 (1).ppt
c program.ppt
pointers CP Lecture.ppt
Algoritmos e Estruturas de Dados - Pointers
Unit-4-1.pptxjtjrjfjfjfjfjfjfjfjrjrjrjrjejejeje
Lk module5 pointers
Chapter 13.1.8
PSPC--UNIT-5.pdf
Pointers [compatibility mode]
Pointers and call by value, reference, address in C
Introduction to c
C Programming Unit-4
The best every notes on c language is here check it out
Lec21-CS110 Computational Engineering
Pointers
Pointers
Ad

Recently uploaded (20)

PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
additive manufacturing of ss316l using mig welding
PPTX
Current and future trends in Computer Vision.pptx
PDF
PPT on Performance Review to get promotions
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Well-logging-methods_new................
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Construction Project Organization Group 2.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
R24 SURVEYING LAB MANUAL for civil enggi
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
Artificial Intelligence
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Foundation to blockchain - A guide to Blockchain Tech
bas. eng. economics group 4 presentation 1.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
UNIT 4 Total Quality Management .pptx
Sustainable Sites - Green Building Construction
additive manufacturing of ss316l using mig welding
Current and future trends in Computer Vision.pptx
PPT on Performance Review to get promotions
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Well-logging-methods_new................
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Construction Project Organization Group 2.pptx
Lecture Notes Electrical Wiring System Components
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
R24 SURVEYING LAB MANUAL for civil enggi
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Artificial Intelligence
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Ad

UNIT 6structureofcprogrammingforppt.pptx

  • 1. Structured Programming using C Unit VI Pointer
  • 2. Contents Pointers 6.1 Introduction, Definition and uses of Pointers, Address Operator, Pointer Variables 6.2 Pointer Arithmetic 6.3 Call by value, call by Reference
  • 3. R.C.Patel Information of Technology,Shirpur
  • 4. Introduction • The pointer in C language is a variable which stores the address of another variable. • The size of the pointer depends on the architecture. (32-bit architecture the size of a pointer is 2 byte). • Every variable stored at a specific memory location and every memory location has its address. • The address can be accessed using ampersand (&) operator. R.C.Patel Information of Technology,Shirpur
  • 5. Introduction #include <stdio.h> int main() { int var1; char var2[10]; printf("Address of var1 variable: %xn",&var1); // Print the memory address of the integer variable var1 printf("Address of var2 variable: %xn",&var2); // Print the memory address of the character array var2 return 0; } the format specifier %x is used to display hexadecimal integers in lowercase(unsigned integer)
  • 6. Whenever a variable is declared in a program, system allocates a location i.e an address to that variable in the memory, to hold the assigned value. This location has its own address number. Let us assume that system has allocated memory location 80F for a variable a. We can access the value 10 either by using the variable name a or by using its address 80F. Concept of Pointer
  • 7. Advantages of Pointers • Pointers in C programming are helpful to access a memory location • Pointers are an effective way to access the array structure elements • Pointers are used for the allocation of dynamic memory and the distribution • Pointers are used to build complicated data structures like a linked list, graph, tree, etc
  • 8. R.C.Patel Information of Technology,Shirpur Usage of Pointers • For passing the argument by using references. • For accessing the elements of an array. • For dynamic memory allocation by using malloc() and calloc() functions . • Used in arrays, functions to improve the performance of code. • Implementing a data structure. • For doing system-level programming.
  • 12. R.C.Patel Information of Technology,Shirpur Null Pointer Example #include <stdio.h> int main() { int *p = NULL; // Initialize the pointer as NULL. printf("The value of the pointer is: %un", p); // Use %p to display pointer value. return 0; } The format specifier %u is used to print unsigned integer values
  • 14. R.C.Patel Information of Technology,Shirpur #include<stdio.h> int main(){ int number=50; // Declare an integer variable 'number' and initialize it with the value 50 int *p; // Declare a pointer variable 'p' of type int p=&number; //stores the address of number variable printf("Address of p variable is %x n",p); / Print the address stored in the pointer 'p' printf("Value of p variable is %d n",*p); // Dereference the pointer 'p' to access the value stored at the address it points to return 0; }
  • 16. R.C.Patel Information of Technology,Shirpur Pointer Program to swap two numbers without using the 3rd variable. #include<stdio.h> int main(){ int a=10,b=20; // Declare and initialize two integer variables 'a' and 'b'. int *p1=&a,*p2=&b; // Declare two pointers 'p1' and 'p2' pointing to 'a' and 'b', respectively. // Print the initial values of 'a' and 'b' using dereferenced pointers. printf("Before swap: *p1=%d *p2=%d",*p1,*p2); *p1=*p1+*p2; // Step 1: Add the values pointed to by 'p1' and 'p2' and store the sum in *p1. *p2=*p1-*p2; // Step 2: Subtract the new value of *p1 by *p2 to get the original value of *p1, and store it in *p2. *p1=*p1-*p2; // Step 3: Subtract the new value of *p2 from *p1 to get the original value of *p2, and store it in *p1. printf("nAfter swap: *p1=%d *p2=%d",*p1,*p2); // Print the swapped values of 'a' and 'b' using dereferenced pointers return 0; } Output Before swap: *p1=10 *p2=20 After swap: *p1=20 *p2=10
  • 17. R.C.Patel Information of Technology,Shirpur Pointer Arithmetic in C We can perform arithmetic operations on the pointers like addition, subtraction, etc. Following arithmetic operations are possible on the pointer in C language: • Increment • Decrement • Addition • Subtraction • Comparison
  • 18. R.C.Patel Information of Technology,Shirpur Example of incrementing pointer variable on 64-bit architecture. #include<stdio.h> int main(){ int number=50; int *p; // Declare a pointer variable 'p' of type int p=&number; // Assign the address of the variable 'number' to the pointer 'p' printf("Address of p variable is %u n",p); // Print the address stored in the pointer 'p' (the address of 'number') p=p+1; // Increment the pointer 'p' by 1. This moves the pointer to the next memory location based on the size of the data type (int in this case, which is typically 4 bytes) // Print the updated address stored in 'p' after incrementing printf("After increment: Address of p variable is %u n",p); // in our case, p will get incremented by 4 bytes. return 0; // %u format specifier is used to print unsigned decimal integers }
  • 19. R.C.Patel Information of Technology,Shirpur Traversing an array by using pointer #include<stdio.h> void main () { int arr[5] = {1, 2, 3, 4, 5}; // Declare and initialize an integer array 'arr' with 5 elements int *p = arr; // Declare a pointer 'p' and initialize it with the base address of the array 'arr' int i; // Declare a loop variable 'i’ // Print a message indicating that the array elements will be printed printf("printing array elements...n"); for(i = 0; i< 5; i++) // Loop through each element of the array {// Use pointer arithmetic to access the array elements and print their values printf("%d ",*(p+i)); } }
  • 20. Pointer to Array // Comparing both the strings using pointers int stringcompare(char *a,char *b) { int flag=0; // Loop through both strings until one of them reaches the null character ('0') while(*a!='0' && *b!='0') // while loop { if(*a!=*b) // Compare the characters at the current position { flag=1; // Set the flag to 1 if the characters are not equal } a++; // Move the pointer `a` to the next character b++; // Move the pointer `b` to the next character } if(flag==0) // If the flag is still 0, the strings are equal; otherwise, they are not return 0; else return 1; } #include <stdio.h> //accepts two arguments pointer to a character int stringcompare(char*,char*); // Function to compare two strings using pointers int main() { char str1[20]; // Declaration of a character array to store the first string char str2[20]; // Declaration of a character array to store the second string printf("Enter the first string : "); scanf("%s",str1); printf("nEnter the second string : "); scanf("%s",str2); int compare=stringcompare(str1,str2); // Call the `stringcompare()` function to compare the two strings if(compare==0) printf("strings are equal"); else printf("strings are not equal"); return 0; }
  • 21. Call by Value #include <stdio.h> // Function prototype for call-by-value void swap(int a, int b); //takes two arguments int main() { int a = 10; // Initialize variable a int b = 20; // Initialize variable b // Display initial values of a and b in main printf("nBefore swapping the values in mainn a = %d, b = %d", a, b); // Call swap function (call-by-value) swap(a, b); // Display values of a and b in main after swap (no change expected) printf("nAfter swapping values in mainn a = %d, b = %dn", a, b); return 0; // Exit the program } // Function to swap two numbers using call-by-value void swap(int a, int b) { printf("nInside the swap function (Call By Value)"); int temp; // Temporary variable to hold one value during swap temp = a; a = b; b = temp; // Display swapped values inside the function printf("nAfter swapping in functionn a = %d, b = %dn", a, b); // Changes will not affect the variables in the main function }
  • 22. R.C.Patel Information of Technology,Shirpur Call by Reference // Function to swap two numbers using call-by-reference void swap1(int *a, int *b) { printf("n Swapping inside function using Call By Reference"); int temp; // Temporary variable to hold one value during swap temp = *a; // Dereference pointer a to get its value *a = *b; // Dereference pointer b to assign its value to a *b = temp; // Assign temp value (initial value of a) to b // Display swapped values inside the function printf("n After swapping in function: n a = %d, b = %d", *a, *b); } #include <stdio.h> // Function prototype for call-by-reference void swap1(int *, int *); function accepts pointers to integers as its arguments. int main() { int a = 10; // Initialize variable a int b = 20; // Initialize variable b // Display initial values of a and b in main printf("n Before swapping in main: n a = %d, b = %d", a, b); // Call swap1 function (call-by-reference) swap1(&a, &b); // Display values of a and b in main after swap printf("n After swapping in main: n a = %d, b = %d", a, b); return 0; // Indicate successful program termination }
  • 23. R.C.Patel Information of Technology,Shirpur Call by value and call by Reference #include <stdio.h> // Function prototypes void swap(int, int); // Function prototype for call-by-value void swap1(int *, int *); // Function prototype for call-by-reference int main() { int a = 10; // Initialize variable a int b = 20; // Initialize variable b // Display initial values of a and b in main printf("n Before swapping the values in main n a = %d, b = %d", a, b); // Call swap function (call-by-value) swap(a, b); // Display values of a and b in main after swap (no change expected) printf("n After swapping values in main n a = %d, b = %d", a, b); printf("n *********************************************** "); // Display values of a and b before calling swap1 printf("n Before swapping the values in main n a = %d, b = %d", a, b);
  • 24. R.C.Patel Information of Technology,Shirpur // Call swap1 function (call-by-reference) swap1(&a, &b); // Display values of a and b in main after swap1 (change expected) printf("n After swapping values in main n a = %d, b = %d", a, b); printf("n *********************************************** "); return 0; } // Function to swap two numbers using call-by-value void swap(int a, int b) { printf("n Output Using Call By Value"); int temp; // Temporary variable to hold one value during swap temp = a; a = b; b = temp; // Display swapped values inside the function printf("n After swapping values in function n a = %d, b = %d", a, b); // Here, the changes will not affect the actual variables in main } // Function to swap two numbers using call-by-reference void swap1(int *a, int *b) { printf("n Output Using Call By Reference"); int temp; // Temporary variable to hold one value during swap temp = *a; *a = *b; *b = temp; // Display swapped values inside the function printf("n After swapping values in function n a = %d, b = %d", *a, *b); // Here, the changes will reflect in the actual variables in main }
  • 25. R.C.Patel Information of Technology,Shirpur