Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



I have a function which accepts a pointer to an int. How can I pass a constant like 5 to it?..

Answer / guest

You will have to declare a temporary variable.

Is This Answer Correct ?    0 Yes 0 No

I have a function which accepts a pointer to an int. How can I pass a constant like 5 to it?..

Answer / om prakash mishra

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

I have a function which accepts a pointer to an int. How can I pass a constant like 5 to it?..

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

Post New Answer

More C Interview Questions

which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

0 Answers  


Is it cc or c in a letter?

0 Answers  


What is the scope of global variable in c?

0 Answers  


What is echo in c programming?

0 Answers  


input may any number except 1,output will always 1.. conditions only one variable should be declare,don't use operators,expressions,array,structure

4 Answers   IBM,


What is your stream meaning?

0 Answers  


What are static functions?

1 Answers  


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

0 Answers   Wilco,


Is it fine to write void main () or main () in c?

0 Answers  


What is null in c?

0 Answers  


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

0 Answers  


What is selection sort in c?

0 Answers  


Categories