passing a pointer to a function

// passing a pointer to function in C
// It increaments the salary of an employee


#include <stdio.h>
void salaryhike(int  *var, int b)
{
    *var = *var+b;
}
int main()
{
    int salary=0, bonus=0;
    printf("Enter the employee current salary:"); 
    scanf("%d", &salary);
    printf("Enter bonus:");
    scanf("%d", &bonus);
    salaryhike(&salary, bonus);
    printf("Final salary: %d", salary);
    return 0;
}

4.25
4
Krish 100200 points

                                    /**
* myFunction - a function that recieves an integer pointer
*/

void myFunction(int *param) {
   .
   .
   .
}

4.25 (4 Votes)
0
4
3
Phoenix Logan 186120 points

                                    #include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;math.h&gt;
void add(int* a, int* b, int* c)
{
    *c = *a + *b;
}
int main()
{
	int a, b, c;
	a = 3;
	b = 5;
	add(&amp;a, &amp;b, &amp;c);
	printf(&quot;%d&quot;, c);
}

4 (3 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
pass pointer c c pointer param function program for passing an argument to the function using pointers pass pointer to function in c pass a pointer to a function c pass pointer to a function c program to pass pointer argument in a function call c c pointer to function as argument c pointer function argument how to return a function pointer via parameter in C function C argument pointer passig pointers in a function in c how to pass pointer as argument in function in c c function declaration with pointer parameter c function pointer as parameters calling a funciton with pointers as arguments in c=+] sending pointer to function as function parameter in c assigning a value to a pointer argument in c passing a pointer to a pointer in c passing a pointer to a pointer to a function in c c program how to pass argument to a function pointer how to pass function pointer as argument in c function pointer as parameter in c passing to func value or pointer in c pointer c function parameter pass function pointer as argument c c pass a pointer to function and call it passing pointer to a function in c how to pass pointer function as argument in c how to pass pointer as argument in c pointer as function argument in c c pass parameter as pointer pointers passed as arguments in c pointer to parameter c pointers as arguments in c pointer as parameter c entering a pointer as a parameter C example how to send a pointer pointer to a function in c passing a pointer to a function as an argument in c c program how to pass pointer c function pointer in argument passing function pointer as argument in c c passing by pointer c functions pass by pointer c programming passing in pointers through functions passing pointer to pointer to function in c c pointer as argument passing pointer as a an argument in c passing pointer and address to function in C pass pointers to functions c void pointer as function argument in c how to return a pointer by parameter in c pass by pointer in c how to send a pointer to a function in c function pointer passing c can we define pointer function and arguments in c can we define function with pointer and argumnet in c how to change pointer passed in from function c function with pointer parameter c pass pointers to function c how to change pointer pass as argument in c C passing on a pointer passing a pointer to a function in c pass the pointer in c to a function how to send pointers to functions in c pointer as an argument in c pointers and function arguments in c c passing function pointer as argument c pass function as pointer how to make a variable and send its pointer to a function in c c function with function pointer as argument c function pointer as parameter how to pass pointer to function in c how to pass pointers to function in c c pass by pointer how to pass a pointer variable to a function in c pass in pointer to function c pass pointer through function c use pointer as arguement in C c pass function pointer how to pass pointers to functions in c pass pointer into function c c pass a variable as a pointer function pointer as parameter c passing a pointer into a function in c function signature with pointer parameter in c can a parameter be a pointer variable in c what happens when you pass a pointer in c passing arguments to function using pointers in c c pass an int pointer how to pass pointer to a function in c C how to pass a pointer into a function C how to pass a pointer to a function a have it point to a value passing a pointerr to a function how to pass value to pointer in c how to pass two argument in funnctuion using pointer c send pointer how to pass pointer in c returning pointer from function in c when do you use pointers in c c pointer parameter send what pointer is poting to into function pass pointer in function how to pass a class function pointer to a function in c how to pass a pointer adress to a function how to pass an address of a pointer to a pointer in c passing in a pointer to a function c how to pass a adress of a pointer in a function in c create function that take pointer to pointer to int as a parameter pass a pointer by reference in c pointer as argument in c pass pointer to function how to pass a pointer by reference in c passing a pointer to a function c how to add pointer in other function c function pointer array how to use e function pointers in c c use function pointer instead of condition how to use pointers in functions c passing pointer to function in c changing and returning it passing pointer to function in c pass pointer form c to asssembly function ptr in function parameter pointer to structure in c print a pointer value in c howt o pass pointer in c using pointer in function c how to pass any pointer in c language c conversions arrys pointers why do we use pointer to a function use pointers as strings passig pointer to a function c set value of a var from pointer passing pointers to a function in c What is argument passing using pointers in c? pointer in parameter c how to pass array pointer in c pointer to a function c c function with pointer as parameter pointer to function c how to pass a pointer by reference in c++; how to pass in and refer to a pointer in a functoin are pointers passed by reference or value pointer to function how to pass a referent to pointer in c pointer on function c how to pass arguments to function with int pointers in c pointers to functions in c passing pointer to function c_ pass pointer by argument c c how to pass a pointer to a function int* ptr pass to function c use pointer in function pointer to function in daty pointer to a function c pass pointer to function take value as pointer function c C FUNCtion that takes a pointer c pass by pointer to function modify original c pass pointer to function but addersses are different c pass pointer to function addersses are different pass pointer of string to function in c pointer to function in c how do i pass the pointer of an array in c how to pass a pointer to function in c how to pass a pointer to function passing pointers into functions in c c how to pass pointer c can you give a pointer a value how to declare a pointer in param c in c do you always have to pass a pointer to a function how to pass array using pointer in c c pass pointer by reference how to pass a pointer to main method [C] how to pass Pointers from functions pointer in function c c using pointers in a funtion how to access a pointer from another cuntion in c pointer as formal parameter c pointer parameters passing pointers as arguments through functions in c send pointers to functions c passing pointers via functions in c ** passing pointers via functions in c passing a pointer by reference c how to pass variables as pointers in c passsing pointers function c how to pass a pointer to a function how to receive a pointer into a function send a pointer to a function c c passing pointer to function using pointer in function argument pointer into function c function argument pointer different ways to pass a pointer to a function function parameter pointer are pointers passed by reference in c c pointer as parameter pass function pointer as parameter in add of two numbers in c how to pass a pointer to a function in c pointer as argument in function passing a parameter by pointer in C how to pass an integer pointer to a function pass pointer to function c function with a pointer parameter c function passing pointer input function using pointer passing pointer through function in c pointer pass to function pointer as a parameter in c pointers in function arguments c passing integer pointer to function in c pass pointer to value in C how to acces pointer that has been passed in c passing pointer in c passing pointers to function in c defined in a functions c function with pointer argument passing pointer to function passing pointer in function c how to pass a variable through a function as a pointer When you pass a pointer as an argument to a function, you must pointer to a function in c Also discuss how pointers make parameter passing smooth while dealing with a function. write a c program to read 10 students information and print using printinfo() function by passing pointer arguments how to send pointer to function in c poiinters to functions pointers as function arguments in c how to pass pointer to function What happened when we pass a pointer into a function in c a pointer can not be passed to a function send massiv pointer to function in C send pointer to function in C pass a pointer to a function in c Passing pointers to functions in c pointers to functions c function taht takes to a pointer to a pointer to integer as parameter pointer in method in c pointer in methodin c pointer in function in c pointer to integer as parameter passing a pointer to a function how to pass pointer to pointer array to function pointers as function arguments using pointers to pass parameters in c using pointers to pass parameters inc c++ enum as srting passing pointers in function argument what if we pass pointer in a function pass the pointer in C using pointer with function c passing pointer variables to another functions in c send pointer to function c passing pointer to function c how to pass pointer to function c how to use a pointer as a parameter in c
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source