Firstly... Like Andreas said... new should not return NULL according to the standard. If allocation fails, it should throw a std::bad_alloc exception, and therefore you should not need to check for...
Umm.. I don't think I understand what you're asking, but there's nothing wrong with the single line of code you posted. (Except from a missing ';' that is!) And certainly nothing that should end up...
If you have already implemented the operator == char* for your class (Looks like you have), and the Text member-variable contains the actual c-string:
bool CStr::operator ==(const CStr& rhs)
{...
The obious thing to do, would be to simply move the definition of a into the for-loop's curlies. That way it will be constructed/destructed each iteration. (Giving you an empty stream each time)
...
Is there any perticular reason you are using a char[10] and not a std::string?
std::string Result;
std::string Str("Hello Gurus, good day!");
int n = 10;
Use a std::ostringstream to build the string before passing it to the messagebox:
#include <sstream>
...
std::ostringstream message;
message << "This is a text with a number: " << 100 << ", and...
Just square the value of the 8bit variable. The 8bit value 256, will then end up being 65536 (the max for a 16bit variable), but 0 will still be 0. Is that what you wanted?
unsigned char some_value...
Since you are passing the struct as a cMyStruct* to the function, how can you not know? The function will recieve a cMyStruct and since member-variable-names are known at compile time, just check the...
No it doesn't. You can't declare variables in the header without using extern. That will lead to one variable being defined for each of the cpp files that include the header. This is the reason for...
I really don't understand why you need to do any casting here. Assuming you only only have one CNode::SetVehicle function (no overloading), it will have to take a cvehiculo* as a parameter to be able...
Well what type does the VehicleList.Add() function take as a parameter? I assume it's a cVehicle*, and in that case, it doesn't matter if the create function returns a cVehicle*, cCar* or a cVan*.
You shouldn't put "using namespace whatever;" in any header file. Doing that will result in that namespace being used by all files that include your header. Something that in turn can result in name...