Is there anything like casting in C++ ?
In Java you could pass an Object of an Childclass as an object of every upper-class.
Type: Posts; User: SuchtyTV
Is there anything like casting in C++ ?
In Java you could pass an Object of an Childclass as an object of every upper-class.
#include <iostream>
#include <fstream>
#include <set>
#include <map>
/*
* Generates a clause_set and a dictionary, given an inputstream
* Returns a clause_set
* Returns a...
Newnode will be initalised on stack.
Then I make a copy of it using &newnode
When now the function returns newnode will be deleted, since it is no longer needed it in the stack.
if I woulld call ...
int init_ODIN_Node(ODIN_Node* pnode, BOARD_STATE state){
pnode->state = state;
pnode->leaves_size = INITIAL_LEAVES_FOR_NODE;
pnode->leaves =...
I think it should work. I make a shallow copy of the Node. The copy will be added and the original will decay.
However all pointers are now stored in the tree?
Am I missing something?
Here is a link to full chess program:
GitHub - SuchtyTV/Odin
Trying to debug this code using Valgrind shows huge memory leaks, which I cannot locate.
I suspect the error to be here:
...
#I am stupid
Thank you!
Hey,
given that;
for(int k = 0; k < 2; k++){
const char *move = create_move_string_by_fields(pmove_data->moves[i][0],
...
Hi,
I have created a CString as:
char* p = malloc(3);
p[0] = '1'
p[1] = '1'
p[2] = '1'
If you look at this code, everythink works just fine.
int filter_all_legal_moves(BOARD_STATE* pboard_state, MOVE_DATA* pmove_data){ //check all moves
for(int i = 0; i <...
Understood! Thank you!
Hey,
I am wondering what this is:
int* a[3]
- Is it a array of int* or
- is it a pointer to an array of ints?
Works fine now! Thank you!
Hey,
I have got the following code:
/* Adds a move string to a MOVE_DATA * If there is no more space left, space of the MOVE_DATA will be doubled.
* Returns 1, if successful
* Returns 0,...
Hey! I am still looking for a answer.
I use eclipse!
Hmm. I amnot sure what you mean by 1.
Thanks for the support to everyone!
15805
Could someone explain to me how to "manage" mutiple files in C-projects?
Hmm. This is my source code:
Everything movd to the includes...
15804
Hey
following code seems not create a warning:
/* * main.c
*
* Created on: Jul 21, 2019
* Author: Niclas Schwalbe
*/
Hey,
since I am using gcc I have troubles compiling things.
I attached a ZIP File, which contains my whole c project...
I definded CHESS_STATE exactly once. But for some reason, he think I...
What is your intension, I want to "assign" to socket_ids[0] and then after all this done, there is one connection more?
Why did not I came up with this idea myself...
void enterConnectingLoop(struct SERVER_INFO* pserver_data, struct JOB_INFO* pjob_data, int sockfd){
listen(sockfd, MAX_CONNECTIONS);
...
Thank you for your support!
To 2.:
That is it. I cannot mutex accept() - because everything will be hold back until a client enters
EDIT: After I fixed everything as you suggested - except the...
Hey Guys,
I have encountered a bug, which I do not fully understand, nor I know why this happens. Also I do not understand how exactly the output which is printed was generated.
If you be so...
How should I declare inlines methods then?
EDIT: Worked! Thank you!