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 |
How can I make it pause before closing the program output window?
#include<stdio.h> int main( ) { Int a=300, b, c; if(a>=400) b=300; c=200; printf(“%d%d ”, b, c); return0; }
sir i wanted to know how we wap in c to add numbers without using arithmetic operator in which digits are entered by user?
can v write main() { main(); } Is it true?
There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
15 Answers Cisco, Google, MBT,
main() { char *ptr = "Ramco Systems"; (*ptr)++; printf("%s\n",ptr); ptr++; printf("%s\n",ptr); } Find the Outputs?
What is the right type to use for boolean values in c? Is there a standard type?
how to find the largest element of array without using relational operater?
Why C language is a procedural language?
prog for 1st five prime numbers in 2^x - 1
can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance
what is void pointer?