Search:

Type: Posts; User: astroboy2000ir

Search: Search took 0.01 seconds.

  1. Replies
    22
    Views
    2,070

    This is the final function; Since this is a...

    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...
  2. Replies
    22
    Views
    2,070

    I couldn't find a solution but there was another...

    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...
  3. Replies
    22
    Views
    2,070

    I added this counter; ...

    I added this counter;



    for(aa=0;aa<ACCU;aa++) {
    b=r[aa]*1000;
    if( b < 1000 && b > -1 )
    bootresults[b]++;
    else{
    counter++;
  4. Replies
    22
    Views
    2,070

    Thank you so much Quzah, I done it and it works...

    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,...
  5. Replies
    22
    Views
    2,070

    I just saw the edit to your #11 post now, I will...

    I just saw the edit to your #11 post now, I will see how it turns out, thank you so much
  6. Replies
    22
    Views
    2,070

    I just tried gcc -g, it a lot of lines came up...

    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)?
  7. Replies
    22
    Views
    2,070

    I changed the designated printf to: ...

    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...
  8. Replies
    22
    Views
    2,070

    I removed the +1 you mentioned but the problem is...

    I removed the +1 you mentioned but the problem is still the same!!!
  9. Replies
    22
    Views
    2,070

    By the way, I had forgot to free the allocated...

    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...
  10. Replies
    22
    Views
    2,070

    You are right about the file checking, but since...

    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?
    ...
  11. Replies
    22
    Views
    2,070

    Yeah, I am using the Pearson product-moment...

    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...
  12. Replies
    22
    Views
    2,070

    Well, that is exactly what I want; you see, the...

    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...
  13. Replies
    22
    Views
    2,070

    This is actually a function in my more general...

    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...
  14. Replies
    22
    Views
    2,070

    strange problem with printf !!!

    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...
  15. Replies
    8
    Views
    13,422

    Dear Evan, Thanks for the fast reply, you are...

    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...
  16. Replies
    8
    Views
    13,422

    Using a function to edit a 2D array

    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...
Results 1 to 16 of 16