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

What does %d do?

738


Explain two-dimensional array.

637


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

655


Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given

2530


What are the advantages of c preprocessor?

726






What is the difference between struct and typedef struct in c?

669


What is the default value of local and global variables in c?

567


What is struct node in c?

631


What is an lvalue?

642


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

748


Can an array be an Ivalue?

676


What do you mean by keywords in c?

640


Tell us two differences between new () and malloc ()?

619


What is a pointer in c plus plus?

702


For what purpose null pointer used?

615