Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.14 seconds; generated 23 minute(s) ago.

  1. Thread: EXE file

    by laserlight
    Replies
    11
    Views
    177

    I think you should post the text of the error...

    I think you should post the text of the error message. As it stands, I cannot read the text shown in the image on my phone as it appears too blurred.
  2. Thread: EXE file

    by laserlight
    Replies
    11
    Views
    177

    Your link appears to be broken.

    Your link appears to be broken.
  3. Replies
    13
    Views
    260

    That is, by definition, dependent on the...

    That is, by definition, dependent on the implementation ;)

    But in practice, it probably essentially looks like this:

    return data[index];


    std::vector models a dynamic array; it is therefore...
  4. Replies
    13
    Views
    260

    You don't need to remove them. Just because they...

    You don't need to remove them. Just because they might be relatively expensive doesn't mean no one will ever really want a copy.


    Just return a const T&. There's no point returning an iterator...
  5. You're right. Unfortunately, what this means is...

    You're right. Unfortunately, what this means is that the project that you've found has a missing file. You'll have to file a bug report or otherwise contact the maintainer to have it fixed.

    EDIT:...
  6. That looks impossible: you commented out the...

    That looks impossible: you commented out the include of errors.h, so how could the compiler still be complaining about its content? It should be complaining about code that depends on what was...
  7. You probably have to #include in...

    You probably have to #include <windows.h> in errors.h
  8. Replies
    32
    Views
    478

    Is this a C project in that you're supposed to...

    Is this a C project in that you're supposed to write a C program to find g(10^15), or is this more of a computer science project such that you could write a C program if you wanted, but could use...
  9. I suggest defining two structures like this: ...

    I suggest defining two structures like this:

    struct sentence
    {
    double number;
    char *text;
    };

    struct sentence_list
    {
  10. What do I mean concerning what? That's head...

    What do I mean concerning what?


    That's head and tail by different names, so refer to my post #2.
  11. Replies
    13
    Views
    260

    That probably makes it a bad idea: C++...

    That probably makes it a bad idea: C++ programmers are likely primed to expect operator[] to have random (constant time) access for an index and at least logarithmic time access otherwise (e.g.,...
  12. Replies
    34
    Views
    356

    Oh, I missed this: It isn't because the inner...

    Oh, I missed this:

    It isn't because the inner loop always loops in successively smaller iterations, whereas you can terminate the inner loop at the point of the last swap in the previous...
  13. Use another static local variable to record the...

    Use another static local variable to record the previous value of x. If x differs from this static local, then you know that it is time to reset exponent.
  14. Replies
    34
    Views
    356

    As in Zeus_'s post #10? That's a bubble sort. It...

    As in Zeus_'s post #10? That's a bubble sort. It is equivalent to the Wikipedia bubble sort article's "Optimizing bubble sort" first example pseudocode, except that instead of just decrementing Size...
  15. Replies
    34
    Views
    356

    This definitely looks like a better candidate for...

    This definitely looks like a better candidate for a bubble sort, and it looks like it was taken directly (with expansion of the swap function/macro) from your "Bubble sort misconceptions" link under...
  16. A tale of two sorts: classifying an inefficient sorting algorithm

    This thread has branched off from wufflz's Bubblesorting Array elements in order to avoid going too far off track for that discussion. It makes reference to Owen Astrachan's Bubble Sort: An...
  17. Replies
    34
    Views
    356

    This is not a bubble sort as it does not always...

    This is not a bubble sort as it does not always swap adjacent elements:

    I guess that's why you call it "dodgy bubble sort", but isn't that just misleading?
  18. That's also a linked list that prepends to the...

    That's also a linked list that prepends to the head, which is not what I'm talking about, unless you want to invert it and say to enqueue to prepend to the head, and to dequeue is to retrieve and...
  19. Replies
    34
    Views
    356

    They don't: this one doesn't always swap adjacent...

    They don't: this one doesn't always swap adjacent elements. Perhaps you missed:

    So, if you agree that terminating early is an optimisation for bubble sort, then it follows that terminating early...
  20. You just need a linked list for which you keep...

    You just need a linked list for which you keep track of both the head and the tail. To enqueue is to append a new node at the tail; to dequeue is to retrieve and remove the node at the head.
  21. Replies
    34
    Views
    356

    Eh, I'm really curious who has been going around...

    Eh, I'm really curious who has been going around teaching students to implement a bubble sort that doesn't stop when no more swaps are performed.
  22. Replies
    6
    Views
    136

    Exactly. atoi suffers from the same design flaw,...

    Exactly. atoi suffers from the same design flaw, which is why strtol is usually recommended as an alternative. strtol switches things around a bit to have the output be a return value and the error...
  23. Replies
    6
    Views
    136

    My question would then be: why is this...

    My question would then be: why is this util_get_string_int when it cannot handle negative number input as would be expected for int? Perhaps it should have been util_get_string_unsigned_int, in which...
  24. Replies
    1
    Views
    111

    This cannot be done purely in standard C, so it...

    This cannot be done purely in standard C, so it would be helpful to know what relevant libraries your teacher has taught or recommended that you use for this exercise.
  25. Replies
    3
    Views
    134

    You might want to read these two technical...

    You might want to read these two technical dictionary entries for abstract data type and data structure. What you have in mind is the former, but when expressed in code we get the latter, which does...
Results 1 to 25 of 498
Page 1 of 20 1 2 3 4