pass the pointer in C
C
// 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;
}
Also in C:
- Title
- c copy string
- Category
- C
- Title
- oop244
- Category
- C
- Title
- how to check the size of a file c
- Category
- C
- Title
- duplicar cadena
- Category
- C
- Title
- sum of arrays
- Category
- C
- Title
- a enum data type in c with loop
- Category
- C
- Title
- how to call the tkinter insert command from another class
- Category
- C
- Title
- arduino knn
- Category
- C
- Title
- switch case c
- Category
- C
- Title
- qtableview get selected row
- Category
- C
- Title
- diferencia entre * y & en c
- Category
- C
- Title
- remove an element from a set
- Category
- C
- Title
- error: ‘cout’ was not declared in this scope
- Category
- C
- Title
- windowns 10 allow ping
- Category
- C
- Title
- ModuleNotFoundError: No module named 'easydict'
- Category
- C
- Title
- mostrar lista recursiva
- Category
- C
- Title
- '&&' within '||'
- Category
- C
- Title
- program using if statement in c whether numnber is less eqaul to greater than 50
- Category
- C
- Title
- entete c/c++
- Category
- C
- Title
- ModuleNotFoundError: No module named 'tensorboardX'
- Category
- C
- Title
- hentai clochette
- Category
- C
- Title
- how to find the ith row of pascal's triangle in c
- Category
- C
- Title
- concatenate two strings in c
- Category
- C
- Title
- chat c socket tcp geeksforgeeks
- Category
- C
- Title
- slurm array job
- Category
- C
- Title
- for loop in c
- Category
- C
- Title
- how to feed a char array to function in C
- Category
- C
- Title
- command line coursera
- Category
- C
- Title
- how to mutex lock in c
- Category
- C
- Title
- infinite loop using while
- Category
- C
- Title
- pi in c language
- Category
- C
- Title
- router solicitation and advertisement magic is used by
- Category
- C
- Title
- lazer codechef
- Category
- C
- Title
- function in c
- Category
- C
- Title
- enum c
- Category
- C
- Title
- how to check the size of a file in linux c
- Category
- C
- Title
- how to print the address of a pointer in c
- Category
- C
- Title
- disable gnu++11 option
- Category
- C
- Title
- tkinter create_line
- Category
- C
- Title
- factorial of a given number in c
- Category
- C
- Title
- PS1 modified lags
- Category
- C
- Title
- arduino digital input pins
- Category
- C
- Title
- accessing elements 2D array using pointers
- Category
- C
- Title
- XAudio2 C
- Category
- C
- Title
- update ubuntu in terminal
- Category
- C
- Title
- change plot line color in matplotlib
- Category
- C
- Title
- uninstall elgg from hostgtor
- Category
- C
- Title
- how to put a char into a string c
- Category
- C
- Title
- how to change the mapping from jkil to wasd in vim
- Category
- C
- Title
- boolean function c
- Category
- C
- Title
- arduino vscode upload choosing sketch
- Category
- C
- Title
- arduino define
- Category
- C
- Title
- how to sleep in c
- Category
- C
- Title
- Declare macro
- Category
- C
- Title
- v
- Category
- C
- Title
- how to write function in c
- Category
- C
- Title
- es fibo
- Category
- C
- Title
- find gcd iteratively
- Category
- C
- Title
- can we write a program without main in c
- Category
- C
- Title
- vbl share price
- Category
- C
- Title
- maximo comun divisor
- Category
- C
- Title
- get current used proxy windows 7
- Category
- C
- Title
- how to open chrome using cmd
- Category
- C
- Title
- convert string to float c
- Category
- C
- Title
- generate all permutations of string
- Category
- C
- Title
- c float to int
- Category
- C
- Title
- c list
- Category
- C
- Title
- powershell list big files
- Category
- C
- Title
- fibonacci series using recursion
- Category
- C
- Title
- sleep in c programming
- Category
- C
- Title
- c if int
- Category
- C
- Title
- c check if char is number
- Category
- C
- Title
- printf("%3d ",XX);
- Category
- C
- Title
- how to print a file c
- Category
- C
- Title
- write array of char to file in c
- Category
- C
- Title
- declare integer c
- Category
- C
- Title
- write a binary file c
- Category
- C
- Title
- inurl:fiu.edu math faculty
- Category
- C
- Title
- strrev in c
- Category
- C
- Title
- lelcetric fied
- Category
- C
- Title
- How to make a printf in c
- Category
- C
- Title
- pop and push shows black screen which needs to be pressed back flutter
- Category
- C
- Title
- c check if file was created
- Category
- C
- Title
- string to int c
- Category
- C
- Title
- set timezone in debian terminal
- Category
- C
- Title
- csrf_exempt
- Category
- C
- Title
- how to ascii art in c
- Category
- C
- Title
- triangulo
- Category
- C
- Title
- c printf right pad with space
- Category
- C
- Title
- mongodb delete all documents
- Category
- C
- Title
- reset c array to zero
- Category
- C
- Title
- c allocate array
- Category
- C
- Title
- how to get random numbers in c
- Category
- C
- Title
- -> operator
- Category
- C
- Title
- ModuleNotFoundError: No module named 'cv2'
- Category
- C
- Title
- what is strikethrough in markdown
- Category
- C
- Title
- does strcat null terminate
- Category
- C
- Title
- /usr/bin/mandb: fopen /var/cache/man/7935: Permission denied
- Category
- C
- Title
- bella ciao lyrics
- Category
- C
- Title
- powershell search big files
- Category
- C