0

Why is this code working only integer type of numbers and no working with float type

If in this code change type float on int, the code is working, another compilation error https://code.sololearn.com/cCVT6trPn13X/?ref=app https://code.sololearn.com/cCVT6trPn13X/?ref=app

25th Apr 2019, 6:15 AM
vitalii
vitalii - avatar
4 Answers
+ 1
the return value is void, which mean that you don't want the function to return any value, but in your code you have a return value, that will probably be an issue for your code
25th Apr 2019, 7:07 AM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
+ 1
You need to return the address of result, not result itself. Then you will need sq_int to be a float pointer. Then you will need to derefercence sq_int in the printf function call. Then it should work.
25th Apr 2019, 10:00 AM
Jared Bird
Jared Bird - avatar
0
and how to be with the void pointer
25th Apr 2019, 9:08 AM
vitalii
vitalii - avatar