I have a function which accepts a pointer to an int. How
can I pass a constant like 5 to it?

Answer Posted / om prakash mishra

u have to take a temporary variable and pass its adress to
the pointer...like that given below:

// assuming all the conditions are given


int temp=5;
function(&temp);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by recursion in c?

634


What does sizeof int return?

598


Can a program have two main functions?

579


When we use void main and int main?

593


What are the types of bitwise operator?

669






What is the purpose of sprintf?

627


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1670


What is difference between Structure and Unions?

650


write a program to print largest number of each row of a 2D array

1878


How does free() know explain how much memory to release?

625


What are the different types of control structures?

592


What is array within structure?

593


What is the general form of #line preprocessor?

592


How can I make it pause before closing the program output window?

585


Write a code to generate a series where the next element is the sum of last k terms.

742