Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Gorgor

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Re: [Linker error] undefined reference to `GetStockObject@4'

    I just had this with the latest and greatest of gcc and minwin and Eclipse (IDE) when compiling a simple win32 "Hello" program that pops up a window with a button.

    Here are the hoops I had to jump...
  2. Replies
    10
    Views
    1,021

    Returning pointer to string literal?

    Is the following valid?



    const char* someFunction( void )
    {
    return "some string";
    }
  3. Which, of course, brings us full circle to my...

    Which, of course, brings us full circle to my subordinate question: The pointer returned IS actually altered.


    In the case of multiple inheritence, where B is an A and a C at the same time, the...
  4. So reinterpret_cast is just a syntax appeaser,...

    So reinterpret_cast is just a syntax appeaser, telling the compiler to think of this pointer as a pointer to x rather than a pointer to y.

    But how would that ever differ from static_cast if both...
  5. I was sure I had read somewhere that casting such...

    I was sure I had read somewhere that casting such objects to other objects in their heirarchy could change the actual pointer value.

    If that is not the case, then how does static_cast differ from...
  6. I, of course, made a mistake in my posting. The...

    I, of course, made a mistake in my posting. The array I meant to be an array of pointers to base, not of the base class itself.



    CBase *myArray[blah];



    Having said that, and having read...
  7. And as a follow up, as a practical matter, if you...

    And as a follow up, as a practical matter, if you don't use multiple inheritence, will the results of reinterpret_cast and static/dynamic_cast ever differ on various compilers? I.e. will the base...
  8. static_cast vs. dynamic_cast and reinterpret_cast

    Let's suppose I have an array of a base class, but it's filled with derived classes. I'll use only one derived class, but suppose there are several types.




    Edit: wrong! CBase...
  9. Replies
    8
    Views
    649

    > In C++, a string has a special meaning -- a...

    > In C++, a string has a special meaning -- a std::string.

    Are you sure? I've been programming in C++ for 10 years now, and when a programmer says "string", they still always mean an array of...
  10. Replies
    4
    Views
    548

    Why even use a float or double to begin with? ...

    Why even use a float or double to begin with? Fixed-level math can better be done with integers, and then only needs to be converted to decimal in the output.



    int amountInCents = 12991;
    int...
  11. Here's your simple pseudocode: int i; ...

    Here's your simple pseudocode:




    int i;

    if (myPoly1.numTerms != myPoly2.numTerms)
    return false;
  12. Replies
    3
    Views
    477

    while (c=getchar() != EOF) putchar(c); /*...

    while (c=getchar() != EOF) putchar(c);

    /* Surprisingly, it doesn't produce zeros while I type; rather it produces some wierd characters that look
    half like zeros and half like smileys. And...
  13. I worked on a system for the Coast Guard once...

    I worked on a system for the Coast Guard once that parsed hand-typed messages that had to locate many different fields.

    We used a "blackboard system", which is basically a 2-phase parsing. The...
  14. In this trivial case, where only member variables...

    In this trivial case, where only member variables are set, then yes, the initializer list is fine. For non-trivial cases where other work is done, say calculations or initializations of more complex...
  15. Replies
    6
    Views
    792

    Four years ago I played Java versions of Space...

    Four years ago I played Java versions of Space Invaders and Asteroids, and they looked better, and played just as well as, anything in an arcade 20 years ago.

    Go for Java and then you can dump it...
  16. Replies
    11
    Views
    800

    Re: Pointer * Question

    > I have hesitated asking for fear of embarassment but... the
    > only stupid question is the one you know the answer to.

    And even then, sometimes it must be asked.

    E.g. "Sandra Bullock, Nicole...
  17. Replies
    13
    Views
    933

    I suppose the professor was teaching the use of a...

    I suppose the professor was teaching the use of a stack to reverse things, but I don't know how much "deep understanding" will be gained by it. Plus it is an extremely klunky looking implementation....
  18. Replies
    2
    Views
    627

    %d in scanf tells it to look for a decimal number...

    %d in scanf tells it to look for a decimal number in the input, not a hexadecimal number.

    If trying to read "C8", the scanf would first see the "C", and choke because that isn't a digit, which it...
  19. Replies
    2
    Views
    540

    If you're printing out a 32-bit hex number, do...

    If you're printing out a 32-bit hex number, do this:


    printf("0x%08x", theHexNumber);


    For 003abcde, will print:

    0x003abcde
  20. Replies
    3
    Views
    627

    int64 alignment?

    I haven't done any 64 bit programming, yet. Do int64's have to be 8-byte aligned, the way 32 bit ints have to be 4-byte aligned?

    If so, that might be another cause of the problem. &some32BitVar...
  21. It seems to be half Ivory Tower talking, cut off...

    It seems to be half Ivory Tower talking, cut off from the real world, and half '60's assembly programmer leftover talking about their old problems.

    In some languages, like pre-Visual Basic (no...
  22. Unfortunately making a function call is not...

    Unfortunately making a function call is not viable. This is a very large project, and that is in a part of code shared with other project. Literally, not figuratively, hundreds of files would be...
  23. They're gettin' a lil' needlessly complex here. ...

    They're gettin' a lil' needlessly complex here.

    Assuming numWords is > 1:



    int firstNounIndex = rand() % numWords;
    int secondNounIndex = 0;

    while ((secondNounIndex = rand() % numWords)...
  24. Operator (cast) override vs. static_cast et al.

    Ok, so I have a class that overrides the (const char *) operator. This override returns a C string that is not the same as the pointer to the class.


    Which, if any, of these calls will invoke...
  25. Replies
    4
    Views
    1,049

    I understand how it works. I know how to pause...

    I understand how it works.

    I know how to pause and sleep and things.

    I was asking if anyone knew how to tell Visual Studio to not close it. Versions prior to 6 (4 at least) have a specific...
Results 1 to 25 of 80
Page 1 of 4 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center