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

Answer Posted / jaya prakash

Only Using type modifiers only constant 5 is sent to
function.

[In previous 2 answers address of variable temp (5) is only
send to fn , not a constant 5]

for that fn-call is

function((int*)5);

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I handle floating-point exceptions gracefully?

636


Can we access the array using a pointer in c language?

564


What are header files and what are its uses in C programming?

638


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

662


What is external variable in c?

614






Explain function?

665


What is extern keyword in c?

646


What is a pointer in c plus plus?

698


What are the types of data types and explain?

673


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

654


Is c procedural or object oriented?

582


Should I learn c before c++?

619


What are local static variables?

620


What is wrong with this declaration?

613


What are the Advantages of using macro

688