Type: Posts; User: ertss
Search took 0.02 seconds.
Hi, I have met a confusing problem.
For example, one square can have 5 states: labeled 1, labeled 2, labeled 3, empty, blocked.
They theoretically I could just use 3 bits to hold the information...
Thanks nuzzle, I will give the two bitset way some thoughts.
If I understood it correctly, are you saying creating a new class object which include two bitset to represent the bits?
TheGreatCthulhu, thanks for helping me to explain this. Yes, i am using the "combined" form to represent
both input at once such that this could be used in the next steps of the alogorithm.
3 just represent the bit that could be either 1 or 0. We just don't care this bit because either choice will yield the same output result.
Sorry for the confusing part.
For example, for a boolean function, there are 4 inputs ABCD, one output K;
if for both the input patterns 1000 and 1001, the output is 1.
Then we say we 'dont care'...
I'm programming an algorithm which needs to operate on bits. I know C/C++ has bitset class. But it is not enough for
me. Because I also need to do the operation with x(don't care) bit...
April 9th, 2011, 08:27 PM
Problem solved, thanks a lot.
I write my code like this.
using namespace std;
April 9th, 2011, 07:36 PM
Could you write a small example code showing me how to provide < operator for node_info?
Is that something called operator overload?
I will try to look up the book for that part.
April 9th, 2011, 06:48 PM
I got it Russco,
Thanks a lot!
April 9th, 2011, 06:43 PM
I have got a list of class type that I need to do list.sort() on.
the class type is
April 9th, 2011, 06:29 PM
And it looks like the second sort cannot be used on list type.
If i do something like this, it doesn't work... why is that?
April 9th, 2011, 06:26 PM
Could any tell me what's the difference between the two kinds of sorting function listed below?
Do they all have nlogn time complexity? It looks like the later one is in the algorithm...
April 8th, 2011, 07:37 AM
Thanks a lot Philip!
u r the best.
April 7th, 2011, 10:30 PM
I have a small piece of code that I want to do a series of function of while(cin>>temp) kind of operation.
But if i input 8 and 9 then enter an non-integer number, the program run past the...
January 9th, 2011, 04:54 PM
Thanks a lot Paul, Best to you!
January 9th, 2011, 09:55 AM
I want to write a func to generate all the permutations of L[1,2,3,4], once at a time and output it in an array...
For example, the first time the func called, it outputs a pointer to...
January 1st, 2011, 08:05 PM
Thank you Eri523! That helps a lot!
But I met another problem with my code using getline(cin,temp);
I changed my code to this. The thing is, the first time in the do...while loop, everything is...
January 1st, 2011, 05:01 PM
Thank you Drmmr.
But I still didn't get how to use push_back when you are dealing with a vector of class type.
For example, in my code, the class type has two private members 'price' and 'title'....
January 1st, 2011, 03:17 PM
I built a class type 'books' which includes the title and the price of a particular book. And I want to use vectors to store all the books information I have. This code should be able to get...
December 27th, 2010, 02:05 PM
And it worked.
December 27th, 2010, 02:03 PM
How to use the getline?
Should I include a header file to make that work?
December 27th, 2010, 01:30 PM
When the following code is executed, we cannot input any string with white-space.
What if I actually want to input several words separated by white-spaces? How should I do that
December 24th, 2010, 11:07 AM
yes... GCDEF, I know what you mean. I'm now reading C++ Primer, although it seems to be a little bit hard for me...
December 23rd, 2010, 08:17 PM
Paul, I don't think it's because of the use of char or string type;
Because the same error still pointed to the constructor usage after I changed the type.
December 23rd, 2010, 08:00 PM
I still cannot figure out what's the problem...
I think I must have misused the default constructor... I did it following a youtube tutorial...
I attached the code from the tutorial and could you...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.