It's not wrong. That would work, in fact.
If you catch yourself writing expressions like this, though:
HMS now(7, 14, 0);
HMS twelve_hrs(12, 0, 0);
now = now.Add(twelve_hrs);
That's an awful lot of extra typing. What if you did this?
// in the class defintion file (.cpp file)
void...
I chose C++ because Visual Basic just simply didn't exist when I started programming.
Pascal, yes... built-in Apple IIe BASIC, yes... even QBASIC... but C/C++ brings a greater level of control and power, a deeper understanding of the underpinnings of hardware, operating systems, programs, and...
You should check out sprintf(), too...
Here's the prototype:
int sprintf( char *buffer, const char *format [, argument] ... );
Where *buffer is usually just an array of char (like char temp[255]), *format is a string that looks like this "%e"...
Here are some example apps written in C/C++:
Windows 95/98/Me/NT/2000/XP
All the Office apps
Linux
Warcraft II, III
Starcraft
Doom
Quake
It's a full-featured, very efficient (when done right) programming language... although VB might be better for quickly creating Windows applications, VB can't...
Also, you need to declare the operators "virtual" if they are not friend functions. That way, the correct one will be called in DerivedClass when you reference it from a BaseClass pointer.
For more info on this, check out Effective C++ by Scott Meyers. It goes into this in great detail.
Programming when you're ten is so cool. If I'd only heard of "C" back then, I wouldn't have started with Apple IIe BASIC. ( =
If you're doing C/C++, the only way to manipulate the console I know of is to use "ncurses"... go to http://www.gnu.org and find it. It might be WAY...
I don't have a lot of familiarity with Borland, but try outputting the character '\n'. That's the newline character, it should work.
Don't they have a TextFileWriter, or something?
By way of sockets... depending on what you're working with, you can go client/server or peer-to-peer.
In client/server, make one of those computers the server, and the other three computers connect to that. Everybody gets their information from the server, and don't make any decisions without...
VC++ treats stdafx.h in a weird way, depending on your project settings. Make sure your project is highlighted then hit Alt+F7 to bring up your project settings. In the C/C++ tab, use the combo box to go to "Precompiled Headers".
Basically, if you are using precompiled headers and...
Yeah, returning pointers is the best way to go.
Of course, if you are making a new object to hold the added values, then Add() doesn't have to return anything. "void" will do nicely.
E.g.:
HMS one;
HMS two;
HMS three;
three.Add(one, two);
If you don't want this, maybe you want...
It is possible... depending how you are exporting your data (the weird, hard "list all functions" way or the sleek _declspec way)...
In your .cpp file, when you declare your static members (they're only defined in the .h file), put this in front of 'em:
_declspec(dllexport)
I usually...
Are you using the STL? Microsoft DLLs don't like the STL, and any exported classes/members using it go bye-bye in a bad way during destruction. Static libraries are okay, but the whole dynamic-loading-linking thing goes nuts.
It has to do with the way processes share memory, the way templates...
Hey there,
You should get some good books on the subject, if you can... Try out these:
High Performance Windows Graphics Programming by Stan Trujillo
Isometric Game Programming with DirectX7.0 by Ernest Pazera
Windows Game Programming for Dummies by Andre LaMothe
Multiplayer Game Programming...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.