Search:

Type: Posts; User: C3Pnuts

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,308

    This is a rather mundane instance but shows what...

    This is a rather mundane instance but shows what I'm talking about.
    Some variable names have been changed to protect the innocent! :D

    This, to me, is much more clear...


    float zeroOrderTerm ...
  2. Replies
    5
    Views
    1,308

    Cost of pushing variable onto stack

    Does anyone have a good reference for what it costs to use a local variable versus using the return value of a method call in C++?

    I hate using a string of method calls together in an equation,...
  3. Replies
    13
    Views
    1,525

    The problem always is, you can learn the language...

    The problem always is, you can learn the language semantics and still be a terrible programmer. You need to understand how to design good classes, using sound object-oriented design techniques. ...
  4. Replies
    0
    Views
    1,015

    Thread creation

    I'm having trouble understanding thread creation in my C++ app. I am writing an app that has a main thread that will launch a processing thread and 24 send threads that will be sending data via MPI...
  5. Replies
    3
    Views
    1,025

    That's kind of what I figured I'd end up doing. ...

    That's kind of what I figured I'd end up doing. Now for a twist on the question though, how do I model this type of program (for instance in Rational Rose)? The classes are easy, but how do you...
  6. You can get past it by including the old...

    You can get past it by including the old (original) C++ libraries ( like #include <iostream.h> ) but that isn't a good idea. Once C++ became standardized, the .h was dropped to distinguish the old...
  7. Replies
    3
    Views
    1,025

    main in a class?

    Ok, my past C++ experience has all been in the Windows environment using MFC so I've never really worried about a main(...) function as the App Wizard took care of all that for me.
    When writing a...
  8. Replies
    4
    Views
    1,207

    What you should be doing is writing an...

    What you should be doing is writing an object-oriented program since you are using an object-oriented language.

    You've got an Employee object that has a salary data member and a getSalary member...
  9. Replies
    4
    Views
    2,207

    You are right about passing by reference. That's...

    You are right about passing by reference. That's the way I had it initially but tried passing by value when I couldn't find any fix for this problem. I forgot to change it back.

    I do have a...
  10. Replies
    13
    Views
    1,546

    Here's the whole list of modes: ios::app ...

    Here's the whole list of modes:


    ios::app The function performs a seek to the end of file. When new bytes are written to the file, they are always appended to the end, even if the position is...
  11. Replies
    4
    Views
    2,207

    There is other code in the cpp file so I need to...

    There is other code in the cpp file so I need to keep it. Why does the templated function need to be in the h file though? Doesn't a #include get you what you need?

    I put the template function...
  12. Replies
    8
    Views
    1,421

    Not to mention most (if not all) games nowadays...

    Not to mention most (if not all) games nowadays are written by huge teams, not a single programmer!
  13. Replies
    4
    Views
    2,207

    Unresolved external with template function

    I am trying to use a template function to overload the >> stream operator but keep getting unresolved external errors (VC++ 6.0).

    The function definition and declaration are:


    // .h file...
  14. Replies
    20
    Views
    2,059

    BINGO!! You got it swoopy! I was writing the...

    BINGO!! You got it swoopy! I was writing the file using << instead of write(...) so even though I had switched my input function to use read(...) I was still reading an improperly created file.
    ...
  15. Replies
    20
    Views
    2,059

    Yeah I had the ios::binary in there in the first...

    Yeah I had the ios::binary in there in the first place but it made no difference.
  16. Replies
    9
    Views
    1,594

    While this is true, the base class will only...

    While this is true, the base class will only contain state and behavior that is common to anything the human can pick up.

    For instance, you could have a class named ObtainableItem (or whatever)...
  17. Replies
    1
    Views
    2,336

    Try this link......

    Try this link...
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_dll_topics.asp
  18. Replies
    20
    Views
    2,059

    Actually, what I want is the data to be a binary...

    Actually, what I want is the data to be a binary stream of the numbers from 100-199 (for my testing purposes).
    Meaning I want binary 01100100 followed by 01100101, etc, with no spaces between them. ...
  19. Replies
    20
    Views
    2,059

    endian issue?

    I think I see where you're coming from. I used hk_mp5kpdw's approach and I am at least getting data in now. My problem is that it appears to be reverse endian from what it should be (i.e....
  20. Replies
    20
    Views
    2,059

    Streaming file input problem

    What's the easiest way to stream unsigned short ints from a binary file into an array of unsigned short ints?
    I expected the language to be able to understand how to stream from an ifstream into the...
  21. Thread: const question

    by C3Pnuts
    Replies
    8
    Views
    1,074

    Just be careful with pointers

    I know you're not talking pointers in your example but just to make sure you realize this, const char *Foo() is not the same as char * const Foo().

    The first is a normal pointer to a constant char...
  22. Replies
    2
    Views
    8,817

    Win Console program environment variable

    I'm trying to translate a UNIX C program to a Windows console program. Can anyone tell me how to set an environment variable in a console program? The UNIX function is setenv, and I find a Windows...
Results 1 to 22 of 24