You can't overload operators that work with just built-in types as you are attempting. You'd have to encapsulate at least one of those arrays in a class and then overload operators for that,...
Type: Posts; User: Polymorphic OOP
You can't overload operators that work with just built-in types as you are attempting. You'd have to encapsulate at least one of those arrays in a class and then overload operators for that,...
the thing is, you are making a check in code to see if the index is in range, but you aren't doing anything about it. the check might as well not be there if you aren't throwing an exception or...
You can do that in C++ -- you just have a member function you can call to deallocate the data prior to destruction, as you were saying with a "dispose" function. If you really want to do it in a...
Not really. Because of the nature of a stack it is impossible to get rid of something not on the top (otherwise it wouldn't be a stack). Imagine this as being a representation of the stack in memory...
not really as the object remains in memory, but initially, calling the destructor explicitly will work anyways -- sort of.
The problem is that while you are explicitly calling the destructor, it...
he didn't do that -- you took the intar:: off the node type, which would give you the wrong type. node is a nested type inside the intarr class.
The problem is that operator= (along with several...
Ha, cool! I did a presentation like that for my high school senior year english class (we were allowed to choose any topic, but had to give an oral presentation for 40 minutes, so I did it on game...
matrix3<T>::V_FCT_PTR fct
msvc++ .net 2003 is correct here -- that won't work because you are using the matrix3<T> template. You have to use typename when refering to a type nested inside a...
Yeah, that's been happening to me a lot lately as well. It's discouraging. What helps, for me at least, is developing projects in a unique manner and adding more abstraction, so even though stuff...
(*dict->entry)->trans->target
order of operations!
That won't work because when you just say
const int A
int class definition, that means you want A to be a const datamember of every instance of the class!
Instead, you have to make it a static...
That's because you're using pointers and copying the address. The assignment operator is called when you copy objects, not pointers. Don't dynamically allocate your objects here -- there is no reason...
.NET 2003 does take up a lot of space, but it's worth it. The compiler is MUCH better than that of 6.0 and .Net. It's incredibly more compliant to the standard than the previous versions. If you get...
Yeah, that's a C-style cast. It's result is like a mix of static_cast, reinterpret_cast, and const_cast -- by that I mean it will perform proper pointer arithmetic when casting via a hierarchy which...
While the latter is correct, and the former is considered proper (though it should return a non-const reference), they're not actually the problem here.
The problem is that the Length() member...
Ah, yes, I should have thought to mention that. My mistake!
I guess if you wanna look at it like that, then yeah, arrays can be considered passed by reference, though I guess it's kind of debatable...
Regarding functions, everything is passed by value in C++ unless you signify otherwise in the function signature (by passing via a reference or pointer, etc.)
Actually, as of C99, C does allow inline functions as a part of the standard.
No. They are very very different. When working with inlined functions, think of it just like it's a regular function in terms of how the data is manipulated, with the desired effect of having the...
In C? Yes.
In C++, No.
In C, NULL is defined as 0 typecast to a void pointer, where-as in C++ it's literally defined as 0.
HEY DUDES MICROSOFT HASNT DONE ANYTHING GOOD EVER AND THEY SUCK. IM COOL CUZ I H8 MICROSOFT. OOPS I MEAN MICRO$OFT <-- LOLZ I USED A DOLLAR SIGN
*shudders*
I'm so glad I don't follow that convention
haha, I really hope that was a joke.
Spaces. I turn on the "turn tabs into spaces" option in VC++7.1 and set tabs to 2 spaces.
Why?
Because tabs cause all sorts of problems with porting to other IDEs. If you are using one IDE...
std::vector<int> Can;