Search:

Type: Posts; User: nomes

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,478

    Include in compile

    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...
  2. Thread: Red Black Tree

    by nomes
    Replies
    2
    Views
    3,685

    Red Black Tree

    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
  3. Thread: Stl Set

    by nomes
    Replies
    8
    Views
    1,386

    Yes I can understand why I SHOULD use a map -...

    Yes I can understand why I SHOULD use a map - however I am trying to implement a set as can already use maps....
  4. Thread: Stl Set

    by nomes
    Replies
    8
    Views
    1,386

    My understanding is that overloading the operator...

    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...
  5. Thread: Stl Set

    by nomes
    Replies
    8
    Views
    1,386

    Stl Set

    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...
  6. Replies
    1
    Views
    944

    strcpy aaarrrrgggghhhh

    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...
  7. Replies
    7
    Views
    2,233

    I have the tokenizer working until I want to copy...

    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...
  8. Replies
    7
    Views
    2,233

    tokenise read in file

    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...
  9. Thread: STL Map Object

    by nomes
    Replies
    6
    Views
    3,458

    I understand the make_pair will insert one object...

    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...
  10. Thread: STL Map Object

    by nomes
    Replies
    6
    Views
    3,458

    Hey, Tried the above to insert Team into Map...

    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...
  11. Thread: STL Map Object

    by nomes
    Replies
    6
    Views
    3,458

    Thanks, Exactly what does the pair function do...

    Thanks,

    Exactly what does the pair function do map....Map the object to
    the key?
  12. Thread: STL Map Object

    by nomes
    Replies
    6
    Views
    3,458

    STL Map Object

    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...
  13. Replies
    6
    Views
    1,302

    Duh!! that worked! Thanks very much!

    Duh!!
    that worked!
    Thanks very much!
  14. Replies
    6
    Views
    1,302

    Yes I tried that in my code i have /*...

    Yes I tried that
    in my code i have


    /*
    #ifdef DLIST_HEADER
    #include DLIST_HEADER
    #else
    #error input DLIST header as string
    #endif
  15. Replies
    6
    Views
    1,302

    No I don't think I do.... I mean I have 2 c...

    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...
  16. Replies
    6
    Views
    1,302

    header file choice

    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...
  17. Replies
    3
    Views
    4,656

    reorder

    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...
  18. Replies
    3
    Views
    4,656

    apparently thru reading I found that a temporary...

    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"...
  19. Replies
    3
    Views
    4,656

    re-order of linked list

    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...
  20. Replies
    2
    Views
    1,040

    Segmetation Fault

    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...
  21. Replies
    5
    Views
    1,825

    /* printf("Sorry about that!! Have it sussed...

    /*

    printf("Sorry about that!! Have it sussed now!");

    */
  22. Replies
    5
    Views
    1,825

    Thanks, fixed it I had a structure with the...

    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*);...
  23. Replies
    5
    Views
    1,825

    I have changed the function pointer to ...

    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...
  24. Replies
    5
    Views
    1,825

    qsort using function ptr

    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...
Results 1 to 24 of 24