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 is typedef?

1014


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

918


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1050


Compare array data type to pointer data type

832


What is pointer to pointer in c with example?

757


what will be the output for the following main() { printf("hi" "hello"); }

10174


write a program to print data of 5 five students with structures?

1846


What are c identifiers?

860


How do you determine a file’s attributes?

825


What is wrong with this program statement?

802


What is self-referential structure in c programming?

903


Can you please explain the difference between syntax vs logical error?

949


Why is #define used?

1027


What are the differences between new and malloc in C?

831


How do you use a pointer to a function?

863