A lamp? Upsidasium ?
I was thinking helium too, but when I really thought about it, a full helium tank is heaver than an empty one. So I guess you'd need to preface it with what was is already in the barrel and is it sealed? A helium tank(barrel) I guess would be lighter than a air tank but I really don't know, because you'd also have to qualify it with the pressure of each. If they were filled to the same pressure, I'd...
User Profile
Collapse
-
-
I answered this question the first time you asked it.
http://www.thescripts.com/forum/thread684507.html
*edit* ahh, I see it's not a new thread, just a new post in an old thread...Leave a comment:
-
There are various ways to avoid if and if else, but they dependent on what you are trying to do, for example starting with the example above:
Code:if ( response == "min") { // Make min object } else if ( response == "max") { blah blah blah }
Code:( (response == "min") && MakeMinObject() ) || ( (response == "max")
Leave a comment:
-
Hmm, me thinks you shouldn't be calling delete *this; but instead just delete this;Leave a comment:
-
Check out this thread
http://www.cpp-home.com/forum/viewtopic.php?t =12389&highligh t=sudoko+sodukoLeave a comment:
-
I've done a couple of Sudoku's in c++. Post your attempts and I maybe can point out what you are doing wrong.Leave a comment:
-
Looks like you are trying to do C++/CLI or managed c++ in a Native C++ project.Leave a comment:
-
It's because you only ask for the answer, and I am not that good(clear) at explaining.
**Edit** another reason is to give others a chance to figure it out...for all they know I could be wrong
It's just algebra, more or less.
Let X = a page number
Therefore X + 1 = the next consecutive page, x+2, the page after that X+n = the last page and n+1 = total number of pages
If two pages were missing...Leave a comment:
-
-
and since now you are using new, you can drop the temp and go back to your original design someVector.push _back(new SomeClass(args[i]))...Leave a comment:
-
No a member functon is Not OK to pass to CallWindowProc.
Now there are ways to craft a C function to accept and use a this pointer, but in this instance, The first parameter of CallWindowProc already has a set signature and therefore cannot take a member function.
To the OP: Here is a link that should help you understand how to accomplish what you are trying to do
http://web.archive.org/web/2005112...Leave a comment:
-
Nice try, but uh...No
He needs to store BOTH numbers not one or the other, for instance he might need to store the numbers 11 AND 12.
11 = 001011 and 12 = 001100, so how do i combine them unambiguously, so that when I am ready to extract I get 11 and 12 back?
As I've stated already, you can't....Leave a comment:
-
CallWindowProc expects a C function (__stdcall) and not a member function.
If pccustgrid->m_wporiglistwn dproc is actually a static function (which i am guessing it's not) you need to use pccustgrid::m_w poriglistwndpro c assuming pccustgrid is the name of the class and not an instanceLeave a comment:
-
The second one since you are deleting the result from char* temp = new char[11];
use delete[ ] with new [ ]
and delete with new
however, you didn't need to make char** item_ptr = items;
You could just use items directly
Code:for(i=0;i<5;i++) { delete[] items[i]; }
Leave a comment:
-
If you use the Comeau Compiler, you could use the export keyword, otherwise and unfortunately, most other compiler makers have chosen not to implement it and therefore your template definitions must be in a single file....Leave a comment:
-
It can't be done....see Pidgeon Hole Principle
0-12 yield 13 possible values
and you need to store 2 which gives you 13*13 combinations or 169 unique combination which would need 7 bits.
Compression won't help, because some combinations are not compressible.Leave a comment:
-
It's because you are compiling in Unicode but passing an ANSI string to your function. Use a wstring instead. and wrap your literals in TEXT("your string")
Other suggestions if you really want to make it Unicode neutral is:
1. use TCHAR.H
2. create a neutral string type like this: typedef tstring basic_string<TC HAR>;
3. use int _tmain(INT argc, _TCHAR **argv instead of...Leave a comment:
-
[CODE=cpp]char filename[25]
filename=oss.st r();
[/CODE]
you can't assign char arrays this way, only in construction like
char filename[25] = oss.str().c_str (); //plus you needed c_str()
but since you are using stringstreams anyway, easier would be
oss >> filename;Leave a comment:
-
It's undefined behavior and not guaranteed to work.
The fact is that the reference is pointing somewhere, and that somewhere can be output and in a trivial program like your example that somewhere is likely to be equal to the same thing it was when used... But there's nothing protecting that somewhere from getting overwritten later in your program which in a larger program would more likely happen and then you'd have problems.Leave a comment:
-
No activity results to display
Show More
Leave a comment: