Can we add floating pointer to variable in C

Showing Answers 1 - 4 of 4 Answers

embeddeddeveloper

  • Nov 23rd, 2007
 

YES OFCOURSE....

#include <stdio.h>
#include <conio.h>

int main()
{
     int myVar;
     float fVal   = 5.5;
     float *pFloat;
     pFloat = &fVal;
    
     myVar = myVar + (int)pFloat;
    
     printf("%d", myVar);
    
     getch();
}

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions