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...
Type: Posts; User: thescratchy
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...
Thank you, should have google it better, before asking...
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?
Thank you guys for your help
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.
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...
Thanx alot!
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...
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...
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...
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...
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...
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...
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?
...
Thank you for the responses.
The problem was indeed in the constructor.
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
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
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...
Thank you all for your responses.
Hello
Can someone explain me why exception handling is used?
I have the following example:
#include "Matrix.h"
#include "iostream"
using namespace std;
ty that was the error
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"
Yes, I need to use inheritance here but I will present your best approach to my teachers.
Thank you for all your help.
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...
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...