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 |
Why do some versions of toupper act strangely if given an upper-case letter?
void main() { char c; while(c=getchar()!='\n') printf("%d",c); } o/p=11 why?
What is a function in c?
What is a stream water?
What does %p mean c?
WHY DO WE USE A TERMINATOR IN C LANGUAGE?
how to implement stack work as a queue?
Why is c called a structured programming language?
how to add two numbers without using arithmetic operators?
program for comparing 2 strings without strcmp()
Explain what is a const pointer?
program to print upper & lower triangle of a matrix