I dunno Visual Studio... and it is damn long since I touched
C...
1) Is there a main function elsewhere? Because if you are just
merely calling this function, values initialised in this function
will be deleted once you exited the function. If so, it would be
better to pass a pointer from the main function for this function
to store it in. Either that or return a value instead of being a
void function.
2) It seems from your code that you can only store 1 value
because float value can only store once. Everytime you scanf, you
rewrite and rewrite the previous values. There are 2 ways to solve
this:
a) you can implement a huge array, and store it in the array.
However, this is rather inefficient as i) there may be portions of
the arrays not used, leading to inefficiency, and ii) there may not
be enough space if the number of ordinates required is larger than
the array size.
b) you can initialise a pointer instead, and allocate a memory
space equivalent to the number of ordinates required using the
malloc function. However, it is important to deallocate the memory
when you do not need it, ie, when you exit the whole program.
I only remember the methodology, the exact code cannot really
remember... But they are easily available online.