Search:

Type: Posts; User: QuestionC

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    3
    Views
    1,532

    You are doing it correctly. The rule is that...

    You are doing it correctly. The rule is that structs use "." to access members, while pointers (to structs) use "->" to access members. This is the sort of error your compiler will safely catch...
  2. Replies
    5
    Views
    2,215

    "NULL" iterator?

    I have some code which is using std::map iterators in a manner similar to pointers. I have a wrapper class around the iterator which facilitates pulling elements out of them. The problem is, when I...
  3. Replies
    11
    Views
    5,001

    A stack is not defined by its structure, so much...

    A stack is not defined by its structure, so much as it is defined by its operations. Basically, anything where you can only remove(pop) the most recently added(pushed) object is a stack. The...
  4. Replies
    5
    Views
    1,253

    No, and it seems unlikely you ever would because...

    No, and it seems unlikely you ever would because not enough people know Z or are comfortable enough with set notation to really use it to communicate. Real-world notation is Use Cases written at a...
  5. Replies
    3
    Views
    1,332

    Probably, one is shutting down, the other is just...

    Probably, one is shutting down, the other is just suspending or hibernating (not a true shut down).
  6. Replies
    7
    Views
    1,329

    Yes. If you do not explicitly free the nodes,...

    Yes. If you do not explicitly free the nodes, they will continue to fill memory. For newer languages, like Java, this is generally not the case.
  7. Replies
    8
    Views
    1,433

    C doesn't handle a < b < c. Break it up. You...

    C doesn't handle a < b < c. Break it up.
    You are trying to fscanf output.


    #include <stdio.h>

    FILE * output = stdout;
    FILE * input = stdin;

    int main(void)
  8. Replies
    16
    Views
    5,206

    Algorithmically, the map solution is actually...

    Algorithmically, the map solution is actually faster than the if...else solution.

    Of course, algorithmic performance doesn't matter if there are only 10 different options to choose from, but still...
  9. Replies
    7
    Views
    1,635

    This reminds me of when I was a kid and my sister...

    This reminds me of when I was a kid and my sister carved her name into the wall and got into big trouble. Being a sibling, she then secretly carved my a wall and told on me.

    It didn't work.
  10. Replies
    23
    Views
    3,616

    You should use iterators to connect the list and...

    You should use iterators to connect the list and map. Don't worry about them becoming invalidated, they won't.



    typedef std::list <CResource *> CacheList;

    typedef std::map <DWORD,...
  11. Replies
    2
    Views
    1,220

    I honestly don't get why they keep up with this. ...

    I honestly don't get why they keep up with this. This form of protection just seems so ineffectual.
  12. Replies
    5
    Views
    3,290

    Thank you SO MUCH. I've looked long and hard for...

    Thank you SO MUCH. I've looked long and hard for that.
  13. Replies
    5
    Views
    3,290

    Help me find a multiplication toy.

    I would like to purchase for my nephew a learning toy that I had as a kid. I can not seem to find it anywhere, and hope that someone here can help me out, since this is a sort of math-related place....
  14. Replies
    11
    Views
    1,371

    Recursion really isn't a loop. You could say,...

    Recursion really isn't a loop. You could say, any loop is a subset of recursion. Any loop of the form...

    loop(N) {
    for (i = 0; i < N; ++i) {
    fn(i);
    }
    }

    Could be expressed...
  15. Replies
    9
    Views
    894

    Post some more code. This is probably a problem...

    Post some more code. This is probably a problem with the value of 'shift' before the loop is even entered.
  16. Replies
    5
    Views
    1,621

    Good News: It is looks pretty easy to make a...

    Good News:
    It is looks pretty easy to make a nice little interface in HTML with JavaScript, packaged as an HTML Application.

    Bad News:
    Explorer spits out more phishing warings and popups than I...
  17. Replies
    3
    Views
    4,514

    To read in a single character, use scanf ("...

    To read in a single character, use

    scanf (" %c", &c);
    Note the leading space, that tells scanf to skip all leading whitespace.
  18. Replies
    23
    Views
    3,616

    I realize you have already honed in upon a clean...

    I realize you have already honed in upon a clean solution, so my comments here are purely academic. Still, I haven't gotten a chance to say some things in response to your last post.




    Lists...
  19. I decided to take a crack at it. I am afraid...

    I decided to take a crack at it.

    I am afraid this is in C, but here is a barebones example of what a list is. It only implements the simplest of list methods (add to head and print).

    #include...
  20. Replies
    5
    Views
    1,621

    GUI Scripting

    I need to create a small GUI which will serve as the front end for a simple shell script. There are a few simple options to pass, the most important of which is a simple interface for specifying a...
  21. Replies
    0
    Views
    1,907

    Linux version of MCS

    So, I just found out about a Solaris tool, and was wondering if there was a Linux equivalent, and what it is named?

    mcs - manipulate the comment section of an object file
  22. Replies
    23
    Views
    3,616

    To elaborate actually, there are two issues with...

    To elaborate actually, there are two issues with removing an element from the tree.

    Removing elements from the tree can hurt its balance.
    If you match every cache miss with a node erasure in...
  23. Replies
    23
    Views
    3,616

    Erasing a single element from a tree is doable,...

    Erasing a single element from a tree is doable, it's just nice to find another method because it's a dirty business, and it is possibly more efficient to just leave all the old elements in the tree....
  24. Replies
    23
    Views
    3,616

    I think I understand what you are trying to do,...

    I think I understand what you are trying to do, except for one detail...

    When you get a cache miss with a full cache, you need to invalidate an old member of the cache as you add a new member. ...
  25. Replies
    9
    Views
    1,085

    I don't know the standard's definition, but in...

    I don't know the standard's definition, but in practice...


    unsigned x; is equivalent to
    unsigned int x;


    x; does nothing. It is a valid expression, but one with no side effects. It's...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4