User Profile

Collapse

Profile Sidebar

Collapse
Darryl
Darryl
Last Activity: Oct 17 '07, 02:22 PM
Joined: May 31 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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...
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to How to run a name chart
    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...
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to avoid If/Else statements
    in C
    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 }
    I could do something like
    Code:
    ( (response == "min") && MakeMinObject() ) || ( (response == "max")
    ...
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to destructors
    in C
    Hmm, me thinks you shouldn't be calling delete *this; but instead just delete this;
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to code for sudo-ku
    in C
    Check out this thread

    http://www.cpp-home.com/forum/viewtopic.php?t =12389&highligh t=sudoko+soduko
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to code for sudo-ku
    in C
    I've done a couple of Sudoku's in c++. Post your attempts and I maybe can point out what you are doing wrong.
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to System namespace won't load (VisualC++ 2005)
    in C
    Looks like you are trying to do C++/CLI or managed c++ in a Native C++ project.
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to Which pages are missing?
    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...
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to Which pages are missing?
    There are 32 pages missing starting with page 291
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to C++ Vector of objects
    in C
    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]))...
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to Application crashing in window procedure :(
    in C
    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...
    See more | Go to post

    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....
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to Application crashing in window procedure :(
    in C
    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 instance
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to which delete line is correct?
    in C
    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];
    }
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to Templates Error
    in C
    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....
    See more | Go to post

    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.
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to Help needed with this code
    in C
    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...
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to Define a string
    in C
    [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;
    See more | Go to post

    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.
    See more | Go to post

    Leave a comment:


  • Darryl
    replied to explain the output
    in C
    huh huh huh he said "int void" :-)...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...