Hello guys ! thanks alot for this website it helped me alot...I have a problem with making a median function works with this code...my array takes the data from a text file and char*,double* and int* dont work here... please help me
I assumed you're only trying to find the median for the first column. To get it built and running, I've made and marked modifications to your code with // change
I hope that the changes will be more informative than a long essay, but they are just the mechanical aspects, you should reconsider the following points, a few minutes searching on this site should sort you out:
# Arrays, especially multidimensional arrays
# Passing arguments to functions, especially arrays and scoping, in particular global vs local variables
# vector<> !!!!
# The importance of semi-colons :-)
The median function should return a floating point value since, for example, the median of [1,2] is 1.5. To prevent integer division, median() should divide by 2.0, not 2. Finally, to get the right answer to main(), median1 should be defined as a float or double rather than an int.
Thank you @tipaye :D :D it worked but if I want to calculate the other column i just change the rank of the array of median1 right ?? and what about doing the standart deviation ?? same way ?