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 ...
Type: Posts; User: C3Pnuts
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 ...
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,...
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. ...
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...
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...
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...
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...
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...
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...
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...
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...
Not to mention most (if not all) games nowadays are written by huge teams, not a single programmer!
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...
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.
...
Yeah I had the ios::binary in there in the first place but it made no difference.
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)...
Try this link...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_dll_topics.asp
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. ...
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....
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...
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...
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...