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 many types of arrays are there in c?

795


What is storage class?

860


Explain how do I determine whether a character is numeric, alphabetic, and so on?

903


what is the format specifier for printing a pointer value?

795


What is a function simple definition?

856


Why do we use int main instead of void main in c?

906


What is array of structure in c programming?

1026


What kind of structure is a house?

783


What's the best way of making my program efficient?

845


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

846


What is the role of this pointer?

772


What is "Hungarian Notation"?

848


Give basis knowledge of web designing ...

1790


Difference between strcpy() and memcpy() function?

877


What is #include in c?

804