Search:

Type: Posts; User: BdON003

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,721

    I solved it. void recover(unsigned int...

    I solved it.



    void recover(unsigned int branch_id)
    {
    unsigned long long mask = gbm.get_younger_branches(branch_id);

    /* mask prints as: 0x7 here */
    printf("0x%llX\n",...
  2. Replies
    2
    Views
    1,721

    [SOLVED] Bit manipulation of unsigned long long

    I am using an unsigned long long to do bit manipulation. When trying to tell if bits are set or not, my code detects that bit 32 is set even when it is not. Here is my code, the if statement is where...
  3. Replies
    4
    Views
    1,281

    Perfect. I haven't used C++ in awhile. I forgot...

    Perfect. I haven't used C++ in awhile. I forgot about conversion operators.

    Thanks
  4. Replies
    4
    Views
    1,281

    [SOLVED] Can objects be used as built-ins?

    I'm wondering if and how to make a class return an integer without calling a member function.

    Example



    int bar (int a);

    int main()
    {
  5. Replies
    9
    Views
    2,801

    Check out this link. It has a few good books...

    Check out this link. It has a few good books http://smart2help.com/e-books/

    EDIT: I'm not sure if it is just temporarily down or permanent.
  6. Replies
    6
    Views
    1,253

    Thanks anon!

    Thanks anon!
  7. Thread: Help

    by BdON003
    Replies
    35
    Views
    3,261

    if (name =='(' || '{' || '[') { ...

    if (name =='(' || '{' || '[')
    {
    a.push(name);
    }
    if (name ==')' || '}' || ']' )


    This part is wrong though I see you had the right idea after it. You need a condition that...
  8. Replies
    6
    Views
    1,253

    I think this takes care of those points, but I'm...

    I think this takes care of those points, but I'm still doing the copy-and-swap wrong so I could use a pointer about that.


    template<class T>
    class SmartPtr
    {
    public:
    explicit...
  9. Replies
    6
    Views
    1,253

    Ok, so I've changed the assignment operator to ...

    Ok, so I've changed the assignment operator to

    SmartPtr<T>& operator=(SmartPtr<T> right)
    {
    if (this != &right)
    { swap(right, *this); }

    ...
  10. Thread: Help

    by BdON003
    Replies
    35
    Views
    3,261

    Sure, at the top, use this instead ...

    Sure, at the top, use this instead

    #include<iostream>
    #include<conio>


    Ok, please mark as SOLVED.

    Seriously though, what kind of errors are you getting?
  11. Replies
    6
    Views
    1,253

    [SOLVED] Reference Counting Template

    I'm having a problem with a template class I wrote that will allow me to have reference counters for object pointers. I have objects contained in multiple lists/queues and I need to prevent the...
  12. Thread: Need C++ code

    by BdON003
    Replies
    17
    Views
    2,928

    You know the economy is bad when computer...

    You know the economy is bad when computer scientists are placing bids to do college homework
  13. Replies
    2
    Views
    1,735

    Excellent! Thanks once again.

    Excellent! Thanks once again.
  14. Replies
    2
    Views
    1,735

    Tokenizing a string

    I'm trying to parse a line from an input file as a hex number followed by four signed integers.

    I found this to work beautifully:

    trace_file >> std::hex >> pc;
    trace_file >> std::dec >> op >>...
  15. Replies
    11
    Views
    2,843

    I don't want the default constructor called...

    I don't want the default constructor called there, I want to say "Hey friendly compiler, I have an object named issue_queue that I will initialize in a few seconds but this is what it looks like"....
  16. Try struct randomStruct { double...

    Try

    struct randomStruct
    {
    double *data
    }; randomStruct

    //...Later on

    int size = 9000;
  17. Replies
    11
    Views
    2,843

    I have a class called IssueQueue. I have a...

    I have a class called IssueQueue. I have a function called initialize() which will read arguments from the command line and initialize an IssueQueue object according to the arguments. I have other...
  18. Thread: Templates

    by BdON003
    Replies
    5
    Views
    2,116

    Heh, I know exactly how you feel.

    Heh, I know exactly how you feel.
  19. Thread: Templates

    by BdON003
    Replies
    5
    Views
    2,116

    That looks like it should be template

    That looks like it should be

    template <class T>
    void ArrayList<T>::add(const T &in)
    {
    arr[avail] = in;
    ++avail;
    }
  20. Replies
    11
    Views
    2,843

    Well that brings me to my original problem then....

    Well that brings me to my original problem then. What I need is to be able to initialize an object in a function ( called void initialize()) and be able to use that object in another function. Taking...
  21. Replies
    11
    Views
    2,843

    That would work. I don't know what I was...

    That would work. I don't know what I was thinking. If I do not know the arguments that will be passed to f at compile time then I will need to use dynamic allocation, thus the new operator, correct?
  22. Replies
    11
    Views
    2,843

    File-scope objects

    Hey,
    I am trying to declare some objects as static file-scope objects but I do not want to initialize them outside of a function.

    I've tried these ways


    static Foo f;
    ...
    void bar()
    {
  23. Replies
    4
    Views
    1,777

    Just make the switch statement in math look like...

    Just make the switch statement in math look like so:

    switch(a)
    {
    case 'x':
    float y = number2();
    answer = x*y;
    break;

    case '/':
  24. Thread: Linking error

    by BdON003
    Replies
    0
    Views
    805

    Linking error

    The problem is that I am getting

    undefined reference to `IssueQueue::full()'
    undefined reference to `IssueQueue::full()'
    undefined reference to `IssueQueue::empty()'
    undefined reference to...
  25. Replies
    3
    Views
    3,758

    Hmm...I see. In that case, I could make...

    Hmm...I see.

    In that case, I could make curr_stage an int and set it equal to a stage and increment will work fine. But how would I then later compare curr_stage with IF, ID or one of the other...
Results 1 to 25 of 48
Page 1 of 2 1 2