im very new at this. so i have max_temps, would I want to define that as a constant and make it something like
sizeof(double)*num_temps
Type: Posts; User: lonewolf367
im very new at this. so i have max_temps, would I want to define that as a constant and make it something like
sizeof(double)*num_temps
Ok, well everything basically works in my program just fine. I just need to make it a tad bit more flexible.
I have a program that reads numbers from a binary file into an array. I have my array...
thanks. i got it working. just had to add a little pointer in there from my function :)
}
// Read data file
double read_file(int num_temps, double temps[])
{
int i=0;
double temp;
FILE *filedata;
filedata = fopen("c:\\labdata.txt","r");
Ok, now it reads the first number in my file. But thats it...
I made changes as suggested but still same error.
Ok I made some changes. However no data is pulled from the text file.
double read_file(int num_temps, double temps[])
{
int i=0;...
I am trying to get a list of numbers from a file and store each number in an array.
I think I have the structure right but I'm getting a memory referance error and the warning that comes up is:
...
Ok, thanks. I switched above,below,average, ect... to be entered into an additional array. That all works now.
However, the sorting does not work. That is the only peice I'm now missing.
oh, i want to pass the array temps[] into the sorting algorithm. i thought arrays were passed by referance.
and the num_temps is what the user imputs so that can chose the amount of numbers they...
This is all I've changed so far:
double temps[N];
int num_temps;
double avg, high, low;
int above, below, equal, more100, more32, less32;
double f_to_c(double f_temp);
double temps[N];
Alright, thanks.
I made all my variables global now.
The compiler errors I am getting are "functiion: incompatible types".
And a few warnings "different types for formal and actual parameter"....
Ok, I am very new to C programming. I have tried to figure this little peice out for like 6 hours now. I just don't quite understand the syntax for user defined functions.
I think I have the code...