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

Write a program to print “hello world” without using semicolon?

674


Why can't I perform arithmetic on a void* pointer?

639


How do I round numbers?

601


Explain about block scope in c?

663


What is structure padding in c?

628






can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1411


Explain how do you override a defined macro?

589


What are reserved words?

656


What are register variables in c?

575


What is the main difference between calloc () and malloc ()?

574


What is clrscr in c?

681


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

559


How can I get the current date or time of day in a c program?

652


What are header files in c?

618


Explain is it better to bitshift a value than to multiply by 2?

718