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 |
5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.
How arrays can be passed to a user defined function
What happens if a header file is included twice?
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
If you know then define #pragma?
Write a c pgm for leap year
11 Answers College School Exams Tests, IBM, TCS,
main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }
What is chain pointer in c?
c pgm count no of lines , blanks, tabs in a para(File concept)
explain memory layout of a C program
What is difference between Structure and Unions?
In which area global, external variables are stored?