Search:

Type: Posts; User: thescratchy

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Simulate the malloc function using a static array

    Hello

    It has been a long time since I used C. So therefore I'm trying to refresh my knowledge by simulating the malloc function. I want to use a static array and I want to "malloc" memory from...
  2. Replies
    2
    Views
    992

    Thank you, should have google it better, before...

    Thank you, should have google it better, before asking...
  3. Replies
    2
    Views
    992

    binary - get amount 1's

    Hello

    If I have a var for example:


    var = 0x0f8a700f

    And I want the number of bits that are true, is it possible to do this without checking every bit one by one?
  4. Replies
    7
    Views
    2,666

    Thank you guys for your help

    Thank you guys for your help
  5. Replies
    7
    Views
    2,666

    If I change my code to the following: ...

    If I change my code to the following:



    unsigned long long n = 63;
    unsigned long long c = 0x8000000000000000;
    c ^= (1 << n);


    shouldn't it work then? I still have the same problem.
  6. Replies
    7
    Views
    2,666

    toggle bit in unsigned long var

    Hello,

    I want to toggle bits in an unsigned long variable. But I get an overflow with bits higher then 31.
    Any ideas how to solve this? Thank you.




    unsigned long n = 63;
    unsigned long c...
  7. Thanx alot!

    Thanx alot!
  8. Alpha beta pruning on Iterative deepening

    Hello

    I am writing a board-game. What I am trying to do is the following: I want to alpha beta prune an iterative deepening tree.

    I know how to alpha beta prune. I know the concept of...
  9. Replies
    4
    Views
    1,436

    Thank you for your link, but I think I didn't...

    Thank you for your link, but I think I didn't explain my question enough.

    When you create a 8x8 array as a board you can put on every cell a piece. That piece is a member of the class Piece. From...
  10. Replies
    4
    Views
    1,436

    chess bitrepresentation - OO question

    Hello

    I want to create a chess game. I am at the stage of looking for the best data structures for my board.

    Board representation (chess) - Wikipedia, the free encyclopedia

    In the given link...
  11. Replies
    3
    Views
    834

    Hello, Yes, In my other thread I use functions ...

    Hello,
    Yes, In my other thread I use functions GetNext(), Tail(), Head() that return a pointer.
    In this function I am basically trying the same thing except in stead of returning pointers...
  12. Replies
    3
    Views
    834

    iterator help

    Hello, I am trying to create a container/iterator.
    But I am stuck.

    My Add Function is wrong, I'm not using pointers correctly.
    But here is the thing:

    I need to make this ex without the...
  13. Replies
    1
    Views
    1,270

    Container - Iterator ++it

    Hello

    I am trying to create a container. But I have a problem with my iterator.
    I can print everything out using a for statement it->getNext(). So I know my container/iterator works.

    But...
  14. Replies
    3
    Views
    997

    Vector question

    Hello, I have created a vector of pointers.
    If I resize my vector, will it be filled in with NULL values?
    Or will it point to garbage? If it will point to garbage, how do I init them on NULL?

    ...
  15. Replies
    5
    Views
    1,986

    Thank you for the responses. The problem was...

    Thank you for the responses.
    The problem was indeed in the constructor.
  16. Replies
    5
    Views
    1,986

    malloc vs new

    Hello

    I have an array of pointers. I want to take a pointer from this array and return this.
    If I use new I get a segmentation fault. But when I use malloc it is ok.





    SegFault
  17. Replies
    3
    Views
    1,320

    Thank you for your response. I think you are...

    Thank you for your response.

    I think you are right.

    Your idea to use an array is a better way then I have stated.
    I think this is ideal.

    Thank you very much
  18. Replies
    3
    Views
    1,320

    dynamic board

    Hello

    I am trying to make a board for a game.

    The board starts with 1 tile, then the first player can place a tile at the 4 borders of this tile,
    The second player can place a tile at the...
  19. Replies
    4
    Views
    1,045

    Thank you all for your responses.

    Thank you all for your responses.
  20. Replies
    4
    Views
    1,045

    Exception handling

    Hello

    Can someone explain me why exception handling is used?
    I have the following example:


    #include "Matrix.h"
    #include "iostream"

    using namespace std;
  21. Replies
    2
    Views
    791

    ty that was the error

    ty that was the error
  22. Replies
    2
    Views
    791

    static member variable

    Hello

    I have a static member variable "total" and I want to use it inside this class.
    Can somebody explain me why this doesn't work?




    #include "Artikel.h"
  23. Replies
    8
    Views
    1,093

    Yes, I need to use inheritance here but I will...

    Yes, I need to use inheritance here but I will present your best approach to my teachers.

    Thank you for all your help.
  24. Replies
    8
    Views
    1,093

    Ok I understand what you are saying but they want...

    Ok I understand what you are saying but they want me to use the classes: Vector and SpaceVector.
    And I need to write in the main the coordinates of the SpaceVector. But I have in the class Vector...
  25. Replies
    8
    Views
    1,093

    Sorry I was confused by what you call: free and...

    Sorry I was confused by what you call: free and member functions.
    I didnt know yet that you call them free functions.

    So you are saying it is possible to do it without the SpaceVector class but...
Results 1 to 25 of 117
Page 1 of 5 1 2 3 4