CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: newbie30

Page 1 of 3 1 2 3

Search: Search took 0.03 seconds.

  1. Replies
    1
    Views
    775

    Hashtables %5 formula

    Hi All;

    Can some one please explain to me what the %5 formula is for the hashtable.

    I am looking at a simple hastable example where the hashtable will contain link lists in it, but when he...
  2. Replies
    7
    Views
    718

    Re: binary operators

    thats what i thought but then i saw other examples and got confused, for example:

    On another website they have this:

    72 & 184 = 8

    why is 8 return and not a 1 or 0;

    Also if you wanted to...
  3. Replies
    7
    Views
    718

    Re: binary operators

    HI;
    Yeah i mean bitwise operators and to see if the last bit is a 1 or 0. Sorry long day but thanks for getting back so quickly

    Thanks
  4. Replies
    7
    Views
    718

    binary operators

    Hi all;

    Doing alot of reading on binary operators but getting quiet confused.

    if i want to find out if the last byte of number 5 is a 1 or 0 how do i go about it?

    I know i need to use the &...
  5. Thread: Hashtable

    by newbie30
    Replies
    5
    Views
    1,016

    Hashtable

    Whats a hashtable and how do you search within a hashtable?

    What are its uses?

    Thanks
  6. Replies
    3
    Views
    595

    Re: bitwise operators

    Sorry ment bit.

    Thanks a mill
  7. Replies
    3
    Views
    595

    bitwise operators

    Hi all;


    I know the theory behind the bitwise operators but i never used them before so just looking for a quick example of the btiwise operators.

    If you want to want to find out what the last...
  8. Replies
    1
    Views
    774

    inline functions and macros

    Whats the difference between an inline function and a macro?


    Thanks
  9. Replies
    7
    Views
    946

    Re: single link lists

    Yeah my variables names are brutal, sorry about that. I understand where your coming from now.
  10. Replies
    11
    Views
    1,878

    Re: Trying to swap 2 elements of a link list

    Hi Guys;

    I am still not sure what you mean about position, do you mean find the 6th elem of the list and switch it ? Surely that would be kinda the same thing i did except that i did it on value...
  11. Replies
    7
    Views
    946

    Re: single link lists

    Why must it be equal?

    Considering the list could be A->B->C->D and the value of swap could be B I need to go thru the list till swap value matches the list value?
  12. Replies
    7
    Views
    946

    Re: single link lists

    So basically something like this:



    void swap(node *swap)
    {
    node *current = head;
    node *temp;
    node *temp2;
    while(swap!=current)
  13. Replies
    7
    Views
    946

    single link lists

    If you a link list with no prev pointer, how do you swap two nodes around?


    For example if we had a list like this:

    A->B->C->D and wanted to switch B & C around, I can get as far as this:
    ...
  14. Replies
    11
    Views
    1,878

    Re: Trying to swap 2 elements of a link list

    Whats the alternative to using next->next, prev->prev and prev->next so i wont run into trouble at beginning of lists and at the end of the lists.





    As regarding swaping two nodes,, i just...
  15. Replies
    11
    Views
    1,878

    Re: Trying to swap 2 elements of a link list

    How would you do it on position? And what do you mean by position?


    Thanks
  16. Replies
    11
    Views
    1,878

    Re: Trying to swap 2 elements of a link list

    Sorry looks like i resolve it, was missing current->prev->next=temp;


    Is there a better way of writing this function, ie less code?

    Thanks
  17. Replies
    11
    Views
    1,878

    Trying to swap 2 elements of a link list

    HI;

    I am tying to swap 2 elements of a link list where the value of the node matches the value i pass thru and swaps with the next element. But somehow it doesnt work.

    Here is the code


    ...
  18. Thread: binary trees

    by newbie30
    Replies
    4
    Views
    495

    Re: binary trees

    Its ok i sorted it, i forgot to new the node.


    Sorry for wasting your time

    Thanks
  19. Thread: binary trees

    by newbie30
    Replies
    4
    Views
    495

    Re: binary trees

    So are you saying i should do something like this:





    node *s = t.search(5);
    ;
  20. Thread: binary trees

    by newbie30
    Replies
    4
    Views
    495

    binary trees

    I have this function in my class:




    node* btree::search(int key)
    {
    return search(key, root);
    }
  21. Replies
    6
    Views
    832

    Re: Question on constructor

    Its ok i got it.

    Thanks
  22. Replies
    6
    Views
    832

    Re: Question on constructor

    Could you show us an example of the constructor initialisation.

    For example if i have a class like this:



    class Temp {
    int x;
    public:
    Temp() {x=4};
  23. Replies
    10
    Views
    1,115

    Re: copy constructors and assignment

    So my whole problem was that i was returning by value!


    Stupid mistake, wont forget that in a hurry. Thanks a mill people
  24. Replies
    10
    Views
    1,115

    Re: copy constructors and assignment

    Why what you have will call the copy constructor? Is it not the same as


    BankAccount S;
    S=T;



    Also i figure out why my assignment operator calls the copy construct, basically if define...
  25. Replies
    10
    Views
    1,115

    Re: copy constructors and assignment

    So would I be right in say that if i had the following code and have written my copy constructor and then my assignment operator that the assignment function be called first and then the copy...
Results 1 to 25 of 58
Page 1 of 3 1 2 3





Click Here to Expand Forum to Full Width

Featured