I have a function which accepts a pointer to an int. How
can I pass a constant like 5 to it?
Answers were Sorted based on User's Feedback
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 |
Answer / 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 |
what is the use of macro program
What are derived data types in c?
Who invented bcpl language?
write a program to copy the string using switch case?
Why does this code crash?
program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5
How can you tell whether a program was compiled using c versus c++?
1)what are limitations for recursive function? 2)write a program to read a text file and count the number of characters in the text file
If fflush wont work, what can I use to flush input?
can we print any string in c language without using semicolon(;)(terminator) in whole program.
How to add two numbers without using semicolon n c????
what is structuer?