Search:

Type: Posts; User: CodeMonkey

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. This is a bit much, but the following might help...

    This is a bit much, but the following might help you to better understand whatever it is you're working with.



    #include <cstdint>
    #include <vector>

    void arrays() {
    // this is an...
  2. I thought I had made another reply, but I think I...

    I thought I had made another reply, but I think I accidentally deleted it.

    I don't know what an array-based unordered list is, but after googling around and reading some Java documentation, my...
  3. C++ has classes, which are user-defined types,...

    C++ has classes, which are user-defined types, and C++ has functions. There are also member functions, which are like normal functions except:
    - They have an additional hidden parameter: "this."
    -...
  4. Replies
    7
    Views
    696

    XAML is valid XML, so you can use XPath...

    XAML is valid XML, so you can use XPath to extract the information you want. I've never used an XML parsing library with XPath in C++ before, but here's what Google has to say:

    - GitHub -...
  5. Replies
    0
    Views
    469

    Generating C++ Code

    Hey good looking people,

    My question is about the general problem of writing a tool (a source-to-source compiler) whose output is C++ and whose input is not. Think protocol buffers.

    In my...
  6. I learned at first by googling for online...

    I learned at first by googling for online tutorials and asking questions on this board.

    However, that's the inefficient way. I didn't even begin to understand the language until I read...
  7. Replies
    2
    Views
    839

    int displayFastestSkier(string name[], double...

    int displayFastestSkier(string name[], double time[])
    // How is 'name' used in this function?
    {
    int x = 0;
    int fastestTime = 1000; // Why 1000?
    for (x=0; x<5; x++) // Why 5?
    ...
  8. Replies
    7
    Views
    751

    What exactly is the goal here? Your question...

    What exactly is the goal here? Your question seemed to be about separating a singly linked list into three singly linked lists based on some property of each node. You said

    I see that a person is ...
  9. In pseudo-code, then: nRows = input() for...

    In pseudo-code, then:


    nRows = input()
    for currentRowNumber in nRows...1
    print currentRowNumber of '@', then '\n'

    or, if you don't want to go backwards:
  10. Replies
    7
    Views
    751

    Announcements - General Programming Boards...

    Announcements - General Programming Boards

    Let's see your code, and what problems it's giving you.
  11. No, phantomotap, I don't think what I'm trying to...

    No, phantomotap, I don't think what I'm trying to accomplish can be achieved without the wrapping classes. In addition to having shared ownership of the resource, a last_ptr also guarantees that it...
  12. I thought that might be a problem. Where is the...

    I thought that might be a problem. Where is the race, though? My understanding is that when waitUntilDeleted() checks isDeleted.load(), a competing thread in markDeleted() must be on one side or the...
  13. Replies
    4
    Views
    1,003

    Python allows you to make that distinction too....

    Python allows you to make that distinction too. While there's no char type like there is in C, python has the functions chr() and ord():


    # Python
    s = 'a'
    first = s[0]
    assert firstChar == s #...
  14. Replies
    9
    Views
    763

    #include #include int...

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

    int main()
    {
    const double zeta5 = 24.88626612344087823196;
    double a, b, c, d;
    const double e = 2.718281828459045235360287;
    double f,...
  15. Replies
    5
    Views
    2,497

    I'm not familiar with lex/yacc. I'm wondering...

    I'm not familiar with lex/yacc. I'm wondering about what your grammar would look like in normal form.

    Is this what you are describing?



    <tree> ::= <node>
    <node> ::= <number>
    | "<"...
  16. You're right, it's simpler to just use a...

    You're right, it's simpler to just use a shared_ptr, and so I think I will.

    But for academic reasons alone, is there a simpler way to achieve what's below?


    #include <memory>
    #include...
  17. I agree with you, Elysia, except for one reason:...

    I agree with you, Elysia, except for one reason: If the "owner" (now part-owner) of the Session holds a shared_ptr, then the Session can go out of scope but is destroyed only later (once the most...
  18. Replies
    1
    Views
    1,483

    That depends on the platform on which your daemon...

    That depends on the platform on which your daemon is running, as the title of your thread indicates. I know nothing about IPC in OSX, so I'd start by googling it:
    cocoa - Best way to do interprocess...
  19. Replies
    2
    Views
    509

    Maybe I'm not experienced enough, but I don't...

    Maybe I'm not experienced enough, but I don't understand what you mean by "add anonymous calls to each object, without adding different methods if logic is changing."
    Maybe you're saying that you...
  20. ~shared_ptr() block until shared_ptr::unique is true

    I'm writing a "Session" class that represents a publishing/subscribing session with a message bus broker.

    I'd like owners of a Session to be able to allocate it however they like, but the Session...
  21. Replies
    6
    Views
    710

    What did you enter, and what was the result? How...

    What did you enter, and what was the result? How did it differ from what you expected?

    For one thing, I can see that 27.15 != 273.15
  22. Replies
    1
    Views
    456

    You have it backwards. Derived* asserts that what...

    You have it backwards. Derived* asserts that what you refer to is of type Derived. An instance of Base is not a Derived, but an instance of Derived is a Base. This


    Base *b = new Derived();
    ...
  23. Your 2d array a is layed out 50 x 50, not n x n....

    Your 2d array a is layed out 50 x 50, not n x n. That's your problem. This might help you see it:


    int main()
    {
    float a[10][10] = {0};
    int i, j, n;

    printf("Enter n : ") ;
    ...
  24. That is odd. If you can live with fixed N, types...

    That is odd. If you can live with fixed N, types are your friend:


    enum { N = 50 };

    typedef struct {
    float data[N][N];
    } Float2d;

    void pass(const Float2d *grid)
  25. A class allows you to group related data together...

    A class allows you to group related data together with the functions that operate on it. The data and functions together can then make guarantees (invariants) to users about the resulting "object"...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4