This is the final function; Since this is a function in a much larger program, I have included <stdio.h> much before;
#include <stdlib.h>
#include <time.h>
#define ACCU 1000 //Desired...
Type: Posts; User: astroboy2000ir
This is the final function; Since this is a function in a much larger program, I have included <stdio.h> much before;
#include <stdlib.h>
#include <time.h>
#define ACCU 1000 //Desired...
I couldn't find a solution but there was another thing bothering me when I ran the program for more than 100,000 times! It took about a minute to run it 1,000,000 times and I was always curious that...
I added this counter;
for(aa=0;aa<ACCU;aa++) {
b=r[aa]*1000;
if( b < 1000 && b > -1 )
bootresults[b]++;
else{
counter++;
Thank you so much Quzah, I done it and it works perfectly with the "prinft", I applied all the modifications and it easily does all the procedure. But as I said, the "prinft" problem still remains,...
I just saw the edit to your #11 post now, I will see how it turns out, thank you so much
I just tried gcc -g, it a lot of lines came up for other functions that had no problem! do you have any good debuggers in mind for Linux (Fedora)?
I changed the designated printf to:
printf("%ld %f\n", bb, r[bb]);
to see how many times it runs over "bb", it is interesting that even when I set ACCU to 1,000,000, it runs the whole way...
I removed the +1 you mentioned but the problem is still the same!!!
By the way, I had forgot to free the allocated memory of "r", thanks for reminding me. I have to admit that I am not yet a professional C programmer yet, I am an astronomer and it is only recently...
You are right about the file checking, but since the output file is there and has the values inside it I considered it merely a decoration for now!!!
How can I check the memory allocation?
...
Yeah, I am using the Pearson product-moment correlation coefficient; as here, as you can see I have calculated in another function (which is working correctly; I have checked). Actually this data set...
Well, that is exactly what I want; you see, the value of r is between 0 to 1 and I only need three digits of it, You are right; the way you have written it is simpler and makes b unnecessary, I will...
This is actually a function in my more general code, basically there is a very very large array of like 100 columns and around 5000 rows, for various properties (~100) of the subjects I am studying...
Hi everyone, I am writing a code to do a bootstrapping test on a set of data I have to analyse for my research, here is the code:
#include <stdlib.h>
#include <time.h>
#define ACCU 1000000...
Dear Evan,
Thanks for the fast reply, you are right, I took away all the complications I had added (deleting the '&', '*' and []s) and it worked fine, I did the same changes the the actual...
Hi every one, I want to write a function that can do some work on a 2D array. I read that functions don't return arrays and the best way would be to set the arguments of the function as pointers to...