Type: Posts; User: OReubens
Search took 0.12 seconds; generated 47 minute(s) ago.
for a "simple" approach to a 2D class, here's a concept, you'll need to fill in some the blanks... :p
template <typename T> // todo: may need allocator
a vector of vectors is NOT a 2D array
if you want a 2D array, then you can 'sort of' simulate this with a vector of vectors, but it has a number of issues that may or may not be relevant to you. ...
You cannot realistically develop a usable game engine model/concept if you have never made games.
It's the experience at making games and how design choices affected your outcome that will teach...
Any part of your game that is generic enough that you could reuse it in a totally new game, probably should go into "engine"
There is Always going to be a grey area in that. If you make a 3D...
February 28th, 2015, 02:47 PM
That is the proper way to avoid the overflow entirely.
And on top of that it's better, because you have moved calculations of your test (every time through the loop) into the initialisation...
February 28th, 2015, 02:46 PM
My point being. unsigneds or signeds aren't goign to save your live. So advocating "use signeds for indexes because" is just going to happen for unsigned as well.
February 27th, 2015, 08:23 AM
If your app needs to handle different types/brands of POS and cash registers: go C/C++.
this is going to be your go-to language for all interfacing.
Some systems have COM objects and thus allow...
February 27th, 2015, 08:10 AM
because indexes that could become negative aren't going to cause errors ? :D
Actually... "the value should never be negative" is a very good reason to make it an unsigned type.
What people often...
February 26th, 2015, 07:46 AM
Well... You can, just be aware of what's going to happen.
This isn't much different from many of the other types of calculations, like mixing integer and floating point.
I found the advice to use...
February 25th, 2015, 08:43 AM
Also note that if your question is about PIXEL positions lying on rendered (pixelated) lines, then the above formula (and 2kaud's) will require a considerable tolerance, so much in fact it may be...
February 25th, 2015, 08:38 AM
Due to how a floating point works...
It is generally speaking impossible to make a check whether a point lies on a line segment. floating points by their very nature are not accurate enough for...
February 25th, 2015, 08:21 AM
It doesn't matter how you do the sleep...
If your code has a "hard" wait in it programmed as a Sleep, SleepEx, for-loop, while-loop, waitable timer, counting sheep, waiting for you to finish...
February 25th, 2015, 08:08 AM
yes, it DOES do that. but...
Why does a consumer of your class interface need to be made aware that the implementation won't "accidentally" change parameter values when this doesn't matter to the...
February 24th, 2015, 08:55 AM
wait... a "simply linked list" ? wot ?
more teachers failing at properly asking questions ?
February 24th, 2015, 08:51 AM
This is technically incorrect. The node XML node can have only 1 namespace.
it's the attribute child elements of the node that have their own (single) namespaces
you can parse and store an...
February 24th, 2015, 08:17 AM
it does, but...
You're loading your public interface with "pointless information" and possibly confusing the class consumer.
For the caller it doesn't matter at all whether the implementation...
February 24th, 2015, 08:03 AM
cursor = what people often (incorrectly) call mouse pointer. It's incorrect because you can have a "mouse pointer" even if your system doesn't have a mouse. It can have a TrackBall, or a cursorpad,...
February 23rd, 2015, 08:17 AM
Changing to IOCP from regular per-thread-blocking calls is goign to be a challenge and will need a major rewrite of the IO code.
192 sockets is "about on the edge" of what you can feasibly handle...
February 23rd, 2015, 08:05 AM
Sleep() (or any other method for achieving the same such as long for-loops) is bad in production code for just about anything other than
1) testing purposes (to simulate a lengthy process or delay...
February 23rd, 2015, 07:50 AM
Rational::Rational(const int denominator, const char sign) // the constructor
While not technically invalid, it is entirely pointless to make POD value types const.
February 23rd, 2015, 07:47 AM
The AddUp() should be done in exactly the same way as you add rational numbers using pen and paper. That should be Obvious enough to do, since this is obviously homework/school assignment, we aren't...
February 20th, 2015, 08:17 AM
Making a thread per connection is an easy way out for a "small scale" app, but it doesn't work well if you need, as you put it "hundreds of connections". Threads are a fairly expensive OS resource....
February 20th, 2015, 08:08 AM
The file you're describing is not what is commonly understood as a "ini" file. So you should avoid giving it that extention.
it appears to be a csv, so the better idea is to give it the .csv...
February 20th, 2015, 08:04 AM
for what it's worth, there is a tendency in C++ to prefer the initializer syntax
over the "assignment" syntax
February 19th, 2015, 07:46 AM
I still is that same stereotype :D
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.