Hey,
Just wondering if anybody can point me in the right direction.
I have a program which I want to choose at compile time which
main file to use (ie main.c || analysis_main.c)
Can I use...
Type: Posts; User: nomes
Hey,
Just wondering if anybody can point me in the right direction.
I have a program which I want to choose at compile time which
main file to use (ie main.c || analysis_main.c)
Can I use...
Hey All
Does anyone know of a site with some example code for the implementation of a Red Black Tree?
In particular am looking for non-recursive top down.
Thanks
Yes I can understand why I SHOULD use a map - however I am trying to implement a set as can already use maps....
My understanding is that overloading the operator causes the comparison (and there for find) to compare between the specified attribute of the object gameNum attribute of the Game class. Otherwise...
I am trying to implement a set to store game objects and use the game attribute gameNum as a key to the set.
I have overloaded the operator in the Game.cpp file as per below:
bool...
Tokenise line from file into vector with the following and am trying to copy vector values to variables - have tried EVERYTHING c_str()
And have NO idea what is happening. Have noted all that have...
I have the tokenizer working until I want to copy each element of
the vector to a string variable (at moment is cout). I am getting a segmentation fault in the "else", the file reads a line and...
I want to write a tokenizer for c++ string. I am reading in a file
which is delimited by each line is delimited by '|' and on the first and every sixteenth the delimiter is '\n'. Is there a class...
I understand the make_pair will insert one object into the map but my program reads in a file of team info I tokenise each line to make a team object, I then insert that pteam1 object into the map ie...
Hey,
Tried the above to insert Team into Map
I am tokenising a file once each line has been
tokenised I instantiate a team object pTeam1 using the tokens
then add the team to the map - Only the...
Thanks,
Exactly what does the pair function do map....Map the object to
the key?
Hi,
Am confused how STL Map object works...
Say I want to store an employee with various attributes
id name pay etc in a map. I can use the ID as a key but am unsure as to the actual setup. Do...
Duh!!
that worked!
Thanks very much!
Yes I tried that
in my code i have
/*
#ifdef DLIST_HEADER
#include DLIST_HEADER
#else
#error input DLIST header as string
#endif
No I don't think I do....
I mean I have 2 c files, and 2 header files list-array.c list-linked.c
list-array.h and list-array.c. I also have an application finder.c when compiled I want the user to...
Hi all,
I have an application carfinder.c which can be used with both an array and a linked list. During compile time I have to provide the carfinder with the appropriate header file and compile...
The following code is my attempt of reordering a linked list. I make a tempHead pointer to the list head and set the list head to null I then iterate thru the list to find the smallest node and add...
apparently thru reading I found that a temporary head pointer and a variation on the selection sort
would cost about O(N^2) time and very little memory. It should
also involve fewer "swaps"...
Hi,
For a list-linked reorder function. My understanding is the only way to do this is using an algorithm to start at the first node calling the compare funcion and swap the order of nodes as...
Hi,
I am writing a program linked-list storing structs, program implements interface. when I call the insert function from main I get the message:
Segmentation Fault (core dumped)
Any ideas...
/*
printf("Sorry about that!! Have it sussed now!");
*/
Thanks, fixed it
I had a structure with the function pointer stored ie
[code]*/
typedef struct List
{
Car list[LISTSIZE];
unsigned size;
int(*CompareFPtr)(const void*,const void*);...
I have changed the function pointer to
[code]/*
int(*CompareFPtr)(const void*,const void*);
/*[code]
and still give parse error message is the correct syntax for a struct (pcl) holding a...
I have two structs one which holds car information. The function I am writing requires to sort the list by an entered key. The list struct holds the function ptr to use. Can I use this pointer in...