Search:

Type: Posts; User: ilikeapplepie

Search: Search took 0.00 seconds.

  1. Replies
    32
    Views
    8,848

    #include #include struct...

    #include <stdio.h>
    #include <math.h>

    struct position
    {
    double latitude;
    double longitude;
    };

    double computeDistance(const struct position *p1, const struct position *p2)
  2. Replies
    32
    Views
    8,848

    i copied and pasted your code. i was getting...

    i copied and pasted your code. i was getting input error till. i removed commas from scanf then i got the big number.

    visual c++ 2008 edition.



    #include <stdio.h>
    #include <math.h>
    ...
  3. Replies
    32
    Views
    8,848

    input 1 2 3 4 output ...

    input
    1 2 3 4

    output
    1726716016253713000000000000000000000000.000000000
  4. Replies
    32
    Views
    8,848

    yes, that worked no error. ty vry much. but now i...

    yes, that worked no error. ty vry much. but now i am still getting a big number even with someone else's code.
    something must be wrong with my compiler. i am really grateful for your help.
  5. Replies
    32
    Views
    8,848

    input : 1 2 3 4 output : input error

    input :
    1 2 3 4

    output : input error
  6. Replies
    32
    Views
    8,848

    sorry, still no help. i am a newbie i don't know...

    sorry, still no help.
    i am a newbie i don't know what's wrong with my compiler. however, if the code works on your compiler at least i know i am on the right track.
  7. Replies
    32
    Views
    8,848

    #include #include struct...

    #include <stdio.h>
    #include <math.h>

    struct position{
    double latitude;
    double longitude;
    };
  8. Replies
    32
    Views
    8,848

    this is the slightly different new code. ...

    this is the slightly different new code.


    #include <stdio.h>
    #include <math.h>

    struct position{
    double latitude;
    double longitude;
    };
  9. Replies
    32
    Views
    8,848

    i am using visual studio 2008 i rebuilt, debugged...

    i am using visual studio 2008 i rebuilt, debugged and ran my program and i still get the same big number.
    come to think of it, my calculation for the distance was initially wrong.

    on x-coordinate...
  10. Replies
    32
    Views
    8,848

    that doesn't help either. i get another i think i...

    that doesn't help either. i get another i think i should sleep now been awake all night and go through my logic. i think my formula for calculating the distance may be wrong as well. i really...
  11. Replies
    32
    Views
    8,848

    hmm, i added the pointers. now there is no error...

    hmm, i added the pointers. now there is no error but i get a weird huge number like


    92559631394.......
  12. Replies
    32
    Views
    8,848

    i am sorry i don't know why the indentation...

    i am sorry i don't know why the indentation disappears.
    i posted my code with the proper indentations.
  13. Replies
    32
    Views
    8,848

    #include #include struct...

    #include <stdio.h>
    #include <math.h>

    struct position{
    double latitude;
    double longitude;
    };
  14. Replies
    32
    Views
    8,848

    when i read directly into the member, i get an...

    when i read directly into the member, i get an error - undeclared identifier.
    also i need to scanf 4 values. so do i need %lf 4 times inside scanf function?
    thanks.
  15. Replies
    32
    Views
    8,848

    please tell me how to rectify my code

    i am not very knowledgeable on structures.
    i want to input x1,y1 of one point and x2,y2 of other and get the distance.

    this is my code but i am getting error.

    #include <stdio.h>
    #include...
Results 1 to 15 of 15