Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void addi(int* ii); //int i = 44;
- float area(float a, float b);
- int main()
- {
- int i = 0;
- int* iptr = &i; //star with datatype => pointer creation
- *iptr = 44;
- printf("before adding i = %d and its address is %x \n", i, &i);
- addi(&i);
- printf("after adding i = %d and its address is %x \n", i,&i);
- float g = area(12.5, 22.6);
- return 0;
- }
- void addi(int *k) //int * k = &i;
- {
- *k = *k + 22;
- }
- float area(float a, float b)
- {
- float area = a * b;
- return area;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement