To be fair, a clearer way of stating that might be "the name of an array decays to a pointer to it's first element" or some such. After all, the "concept" of a pointer is a variable that stores the...
Type: Posts; User: gardhr
To be fair, a clearer way of stating that might be "the name of an array decays to a pointer to it's first element" or some such. After all, the "concept" of a pointer is a variable that stores the...
From scratch? Difficulty level == high. Not sure if there are any libraries available to do such a thing, though. Try Google?
So let me get this straight. You wrote your very own implementation, but yet you don't know how to correctly declare a char array, how to call a function, or how to write code in main that makes any...
A tool that can handle all types of object files is probably not going to be easy to find simply because the format is so compiler dependent. On the other hand, decompilers for executable formats...
Unsubstantiated rumors of ruby red slippers have circulated from time to time (mostly in film), but that claim that has been vehemently denied by the Wizard of Carat, who insists that he has never...
recQS() shouldn't need to be declared a friend since it just takes a vector and two integers as arguments. But sort() no doubt needs to be (unless of course you just make it a member function, which...
What exactly do you not understand about the output?
Actually, you should be able to pun a native array directly to an std::array and vice versa.
int main(void)
{
assert(okay_to_cast_std_complex_to_array<float>());
const std::size_t size =...
First of all, this ain't an ambiguity issue. It's called "What happens when we use macros incorrectly?". Second, the answer to your question will reveal itself once you expand the macro "manually" in...
Most likely, but it's certainly not guaranteed. First, there is the alignment issue. As long as we're talking about complex<POD>, however, that shouldn't be a problem. The next question is whether or...
You could also either specify the template parameter explicitly (foo<double>(0, 0.5)) or else cast the integer literal to double. Laserlight's suggestion really makes the most sense, though. As they...
One more important point: This isn't simply a memory leak issue. Consider a situation where you're allocating an object that writes data to a very fragile file; failing to deallocate it properly...
Basically, whenever you assign an allocation to a raw pointer (except where explicitly "guarded" by a destructor) you're writing exception unsafe code! That is, if an exception gets propagated within...
Of course! Such an unbelievably silly mistake, too. Oh well, problem solved now. Thanks so much for the keen eyes. Cheers!
Is there a good reason why you're not using an std::vector or similar to manage the memory? Because as it stands you're code isn't exception-safe (not to mention that your problem at hand is most...
Okay, so I've put together a basic LFSR class as well as a test driver to verify that it was implemented correctly (the driver employs a brute force approach that simply cycles through every possible...
That shouldn't even compile. std::istream::operator >> returns an std::istream&, and std::getline doesn't take any such parameter. Plus you've got an extra closing parenthesis at the end there....
Sorry, your program is neither stable nor secure, and lacks even the most basic level of encapsulation. Read up on buffer overflows and how to prevent them, and consider storing a hash or some such...
In practice it should work fine. That said, I'm not so sure that it's guaranteed by the standard, and besides that it's probably considered "bad form". A more conventional approach would be to simply...
No, that's still going to reject a lot of valid strings. Just verify that the very next character isn't alphabetical and everything should work fine.
First try to implement everything as best as you can. Once you get stuck somewhere at that point then post here for advice. Beyond that, I would say put everything into functions; modular code is...
Quite the opposite, actually. Each power-of-two sub-convolution is done in it's own stage (hence, "butterfly") so in fact the individual terms can be splitup, calculated in tandem, and then combined...
In that case for your single byte packets why not just perform a CRC on the data "transposed" to two bytes. So for example if the data byte is 3F, calculate CRC(3F3F). For even better distribution...
Hmm, I wonder if a polynomial with more terms (and thus more "taps") might do a better job propagating errors in smallish data streams?
That sounds like a good strategy. Trying to interoperate with third party products can be a real pain in the arse sometimes, no doubt. Especially when the customer doesn't even make a distinction...