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",...
Type: Posts; User: BdON003
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",...
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...
Perfect. I haven't used C++ in awhile. I forgot about conversion operators.
Thanks
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()
{
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.
Thanks anon!
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...
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...
Ok, so I've changed the assignment operator to
SmartPtr<T>& operator=(SmartPtr<T> right)
{
if (this != &right)
{ swap(right, *this); }
...
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?
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...
You know the economy is bad when computer scientists are placing bids to do college homework
Excellent! Thanks once again.
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 >>...
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"....
Try
struct randomStruct
{
double *data
}; randomStruct
//...Later on
int size = 9000;
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...
Heh, I know exactly how you feel.
That looks like it should be
template <class T>
void ArrayList<T>::add(const T &in)
{
arr[avail] = in;
++avail;
}
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...
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?
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()
{
Just make the switch statement in math look like so:
switch(a)
{
case 'x':
float y = number2();
answer = x*y;
break;
case '/':
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...
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...