Search:

Type: Posts; User: radnik

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Replies
    10
    Views
    1,549

    Thanks for your suggestion, but i need to have...

    Thanks for your suggestion, but i need to have boost libraries for that and i wouldn't like to have any dependencies.
  2. Replies
    10
    Views
    1,549

    You are right. What a stupid mistake. I should...

    You are right. What a stupid mistake. I should have used argv[2]. Thanks for your help MacGyver.
  3. Replies
    10
    Views
    1,549

    First of all i've read the reference, and second...

    First of all i've read the reference, and second if that is so why does this come up with a segmentation fault?:


    double speed;

    speed=strtod(argv[3], NULL);

    or even this:
  4. Replies
    10
    Views
    1,549

    strtod takes a string while argv[] is a pointer....

    strtod takes a string while argv[] is a pointer. How can i copy the value of argv[3] to some sort of string to pass it to strtod?
  5. Replies
    10
    Views
    1,549

    Command line argument types

    I have class goto(speed), that takes double as an argument. What i would like to do is to allow user to set the speed when running the program from command line. The start of program would look like:...
  6. Replies
    52
    Views
    14,630

    Ok i have problem again right at the start. I...

    Ok i have problem again right at the start. I don't know how to pass vector with index (vector[x]) as function argument. I did this:

    double distance (Paths path[i]) {
    double dist, tmp;

    for...
  7. Replies
    52
    Views
    14,630

    Ok, thanks. I'll try that later today and post...

    Ok, thanks. I'll try that later today and post you on how it went.
  8. Replies
    52
    Views
    14,630

    You can see the formula i need to use on this...

    You can see the formula i need to use on this link:
    http://en.wikipedia.org/wiki/Euclidean_metric.
    I thought to calculate distance for all paths and store these values in vector of doubles. Then...
  9. Replies
    52
    Views
    14,630

    Dwks thank you very much, this is great. I have...

    Dwks thank you very much, this is great. I have only one more thing to do. Now i must calculate Euclidean distance for all paths in trajectories vector. Sort them and find the shortest path so i can...
  10. Replies
    52
    Views
    14,630

    If i'm right the repeating of numbers occurs...

    If i'm right the repeating of numbers occurs because i never clear my pairs vector so those old coordinates remain in the vector. How can i solve this? I've tried this:


    while (stmp >> x >> y) {...
  11. Replies
    52
    Views
    14,630

    You are right laserlight. Sorry for the Croatian...

    You are right laserlight. Sorry for the Croatian language. I will post English version now. I don't know what you mean by formatting of code because all of the "layout" was done by my editor i didn't...
  12. Replies
    52
    Views
    14,630

    Anyone?? :(

    Anyone?? :(
  13. Replies
    52
    Views
    14,630

    Guys i'm really desperate here. I'm obviously...

    Guys i'm really desperate here. I'm obviously doing something wrong and i don't know what. I post the code and you compile it and look at the output. I have no clue what is the problem and i'm sure...
  14. Replies
    52
    Views
    14,630

    I know that, but when i read two values x and y...

    I know that, but when i read two values x and y how can i do bush back. How can i know that it will read the x value in vetor.x and y in vector.y?So when i read the values from file like this:

    ...
  15. Replies
    52
    Views
    14,630

    Thanks, that helped a lot. What do you suggest me...

    Thanks, that helped a lot. What do you suggest me to do on writing numbers of one path in vector Path. Since i don't set it's size (for logical reasons) i can't use something like:


    while (stmp...
  16. Replies
    52
    Views
    14,630

    I'm stuck again. Now when i do something like: ...

    I'm stuck again. Now when i do something like:


    string tmp;

    getline(dat, tmp);
    stringstream stmp(tmp);

    i have stringstream stmp with one line of numbers from txt file. But how do i read...
  17. Replies
    52
    Views
    14,630

    Oh, i see. Thank you guys very much.

    Oh, i see. Thank you guys very much.
  18. Replies
    52
    Views
    14,630

    Can someone please help me with this...

    Can someone please help me with this stringstream. Just give me a good link if you know it or explain it to me how to parse integers from string with it please.
  19. Replies
    52
    Views
    14,630

    Ok, thank you. Where can i read about usage of...

    Ok, thank you. Where can i read about usage of getline and stringstream because i don't have any books on c++?
  20. Replies
    52
    Views
    14,630

    Here's the file. This is just one example. The...

    Here's the file. This is just one example. The file can have unknown number of lines (paths) and unknown number of point per path (where first number is x, second y, third x and so on):


    12 14 15...
  21. Replies
    52
    Views
    14,630

    Thanks matsp. In the first solution i didn't use...

    Thanks matsp. In the first solution i didn't use the class approach but typedefs. The compiling went well but when i run the program with correct file path to open i get a segmentation fault. Can you...
  22. Replies
    52
    Views
    14,630

    WHre in the code should i put the operator...

    WHre in the code should i put the operator overloading main() or...? Because i got this error on compiling:
    eg_decomposition.cpp:34: error: 'std::ostream& Koord::operator<<(std::ostream&, Koord)'...
  23. Replies
    52
    Views
    14,630

    Ok you lost me completely there. I don't know...

    Ok you lost me completely there. I don't know anything about operator overloading. How can i do that? (this c++ is complicated as hell). I've started something on the class approach so i will post my...
  24. Replies
    52
    Views
    14,630

    The code is almost the same as the one before: ...

    The code is almost the same as the one before:


    #include <iostream>
    #include <cstdlib>
    #include <fstream>
    #include <vector>
    using namespace std;

    class Koord { //varijabla vrijednosti...
  25. Replies
    52
    Views
    14,630

    I figured out that one object represents on...

    I figured out that one object represents on complete path, but i don't understand how should i implement collection of object (full collection of complete paths) since i don't know the number of...
Results 1 to 25 of 35
Page 1 of 2 1 2