Search:

Type: Posts; User: Ushakal

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. You want a pointer to a pointer? int* p =...

    You want a pointer to a pointer?



    int* p = new int;
    int** pp = &p;


    Then pp contains the address of the pointer p.
  2. Replies
    10
    Views
    2,237

    manasij is right, you can't assign a non-static...

    manasij is right, you can't assign a non-static member function to a function pointer. The code manasij posted would work if the member function foo() was made static (i.e., "static void foo();").
  3. Thread: Braid

    by Ushakal
    Replies
    3
    Views
    22,331

    The language it was coded in was almost certainly...

    The language it was coded in was almost certainly C and/or C++.

    The original developer, Jonathan Blow, developed the game for Xbox 360's Xbox LIVE Arcade and Windows. As far as I know, he did all...
  4. Thread: C++ on Mac OSX

    by Ushakal
    Replies
    5
    Views
    3,378

    I thought Mac developers tended to use...

    I thought Mac developers tended to use Objective-C rather than C++, but I'm not sure.

    I think most people on these forums use a Linux and/or Windows environment, but you'll be able to find help...
  5. Replies
    29
    Views
    4,763

    There's really nothing wrong with using C#/XNA to...

    There's really nothing wrong with using C#/XNA to program games; the slight performance disadvantages over C/C++ with DirectX/OpenGL will generally not be a problem unless you're doing some really...
  6. Why not try putting the SYSTEMs in an std::map...

    Why not try putting the SYSTEMs in an std::map instead of an std::vector? Then you can have a function to get a specific system from a key, like so:


    enum SysID
    {
    Input,
    Graphics,
    ...
  7. Replies
    7
    Views
    1,851

    All you need to do is delete the extra white...

    All you need to do is delete the extra white space in front of the braces using backspace or delete. It's just a text editor, and the white spaces are just tabs. It's simple enough to correct the...
  8. Replies
    7
    Views
    1,851

    How do you mean they don't close properly? If...

    How do you mean they don't close properly? If it's just indentation you can simply delete the white space in front of the braces at the end until they align properly. Does the code compile and run?
    ...
  9. Replies
    2
    Views
    1,481

    First of all, it wont compile: it's std::cout (or...

    First of all, it wont compile: it's std::cout (or you can put "using namespace std;" after the include) and you should be including <iostream>, not <iostream.h>.

    I'm not going to tell you the...
  10. Replies
    12
    Views
    1,791

    Thanks. :D

    Thanks. :D
  11. Replies
    12
    Views
    1,791

    Can you point me in the direction of any decent...

    Can you point me in the direction of any decent articles about memory paging? I know it's wrong, I just don't know why. What are the consequences of a page fault and why do they occur? Are there any...
  12. Replies
    2
    Views
    1,577

    You might want to post questions specifically...

    You might want to post questions specifically about Windows programming in the Windows programming section of the forum (Windows Programming), but I'll try to help.

    You can't pass a WndProc...
  13. Replies
    12
    Views
    1,791

    Like I said, the code I posted isn't meant to be...

    Like I said, the code I posted isn't meant to be a real world implementation; it's simply an example of what I mean (and the actual amount of memory allocated isn't of importance right now). I want...
  14. Replies
    12
    Views
    1,791

    Custom Memory Allocation

    I recently discovered that dynamic memory allocation is pretty slow, so I've been thinking of a way to get around that. I've been thinking about going into low level video game engine programming...
  15. Replies
    7
    Views
    5,558

    This isn't a problem with inclusion guards,...

    This isn't a problem with inclusion guards, though it's a good idea to have them anyway. The problem is that you're "redefining" your class in the .cpp file. You should remove the public/private...
  16. Replies
    15
    Views
    1,711

    Have you made any attempt to do it yourself? If...

    Have you made any attempt to do it yourself? If so, please show us some code so we can help you.
  17. Replies
    2
    Views
    4,480

    This code appears to be riddled with issues, but...

    This code appears to be riddled with issues, but you haven't specified the exact problem you're having (do you get any compiler/linker errors?) and you haven't posted all the code, so there could be...
  18. Replies
    3
    Views
    1,096

    Have you tried sending "56:00:26:00" as a C-style...

    Have you tried sending "56:00:26:00" as a C-style string?
  19. Thread: cin.ignore()??

    by Ushakal
    Replies
    12
    Views
    3,642

    Ah, I see. Thanks for the info. Yeah,...

    Ah, I see. Thanks for the info.



    Yeah, sorry, my mistake.



    Thanks for the article; it was very informative, thanks. I only just stopped using system("PAUSE") a few days ago myself, after...
  20. Replies
    3
    Views
    2,389

    The problem is in the function calcSubtotal: ...

    The problem is in the function calcSubtotal:


    float calcSubtotal (float installation, int discount, float& discountamount)
    {
    discountamount = installation * (discount / 100);

    return...
  21. Thread: cin.ignore()??

    by Ushakal
    Replies
    12
    Views
    3,642

    You can do something like: ...

    You can do something like:


    cin.ignore(cin.rdbuf()->in_avail);

    rdbuf returns a pointer to the underlying stream buffer, and in_avail returns the number of characters available to read. That...
  22. Thread: cin.ignore()??

    by Ushakal
    Replies
    12
    Views
    3,642

    Yeah, sorry, I tried to edit out before anyone...

    Yeah, sorry, I tried to edit out before anyone read it. :P I tested it myself and it seemed to work (and you're right, of course, about initialising count to 0). I didn't realise it would work like...
  23. Thread: cin.ignore()??

    by Ushakal
    Replies
    12
    Views
    3,642

    cin.ignore(), or istream::ignore(streamsize,...

    cin.ignore(), or istream::ignore(streamsize, int), discards all the characters in the cin stream until it has discarded the amount of characters specified by the first argument(in this case, 1000),...
  24. Replies
    4
    Views
    2,906

    Have you recompiled the program since making the...

    Have you recompiled the program since making the changes?
  25. I see. Alright, thanks.

    I see. Alright, thanks.
Results 1 to 25 of 50
Page 1 of 2 1 2