Search:
Type: Posts; User: NMTop40
Search:
Search took 0.26 seconds.
-
He was going to change it to point to an empty string.
As for operator+, it is to allow efficient implementation of this that the standard does not require that it internally holds a contiguous...
-
If this is not practice but something you need in reality then use std::list and splice.
-
Problem of pointing it to "" is that your destructor is now trying to illegally delete it. Before when it was NULL it was ok to call delete on it, but you cannot call delete on the pointer here.
...
-
When you allocate memory inside a DLL you must always deallocate it in the same DLL, i.e. you must have some callback method to do the deletion, and not call delete from the client.
If it is a...
-
Using m_ as a prefix is quite a popular notation.
-
The problem with the solution above is that OSXController and Win32Controller would need to be implemented even on the other platforms.
with #defines you only need it to compile on the platform...
-
I have written my own message queues (prodcon_queue) for multi-threaded systems but it is fairly complex. I had to write a mutex wrapper and a condition variable wrapper.
boost may have one though...
-
Remember though that in Java there are no headers and forward declarations so you expose your class implementation to whoever is using the class. Yes you do have interfaces but they are like abstract...
-
When I coded in Java I commonly made the mistake of forgetting to initialise members, eg collections, so I would for example have a vector as a class member and try using it forgetting that it was...
-
english, math and history looks like types of course, not types of student.
public inheritance means "is a kind of".
-
You've introduced a "magic" address into your code.
You can do this sort of weird syntax in the IDE debugger where you see the pointers. Not normal to put it into your code.
-
acos of 0 is well defined to be pi/2
-
1. You can use meta-programming which is what is happening with boost functions. You have a class that looks something like this:
class func
{
public:
void operator() ();
}
-
Using friend can increase encapsulation over the alternative of leaving lots of members public because one closely-related class needs access to them.
In the case of a class whose instances should...
-
You can use boost/tr1 here but you need a custom deleter to do nothing with the one passed in as a parameter.
You can also possibly use auto_ptr which is left empty if not used.
Example with...
-
If you put DATE_H in your code somewhere the compiler would replace it with no code.
This is actually used sometimes for compiler-based situations in portable code where you need to insert certain...
-
One guess for a start is that MSSB is reading from the wrong side, but do not convert to a string and use find_first_of, why not just use std::bitset's in-built functions?
-
You would do the above so you can pass f to a C API for example as a thread function (although they don't normally return double).
-
If you specify a default value for the function then you can call it without passing in an argument.
What I think you are looking for though here is a callback function, and there are differences...
-
What you must pick up in C++ that is not there in Java is having to manage resources by use of automated destructors.
C++ does not have memory garbage collection the way Java has it but does have...
-
This seems to be two questions in one, one regarding arrays/vectors and another regarding passing a member function as a parameter.
-
You have a constructor with a default parameter to an invalid value. If someone constructs a FunnyString with its default constructor it will cause undefined behaviour (probably access violation /...
-
You have 2 source files and both of them need to be built then linked together.
It seems strange though that you are using the command-line linker.
By the way, while we are here make main()...
-
I don't know the test but there are a few things funny about your code sample. I guess some of the one-letter identifiers may be "standard" within the mathematical realm of that formula, however...
...
-
September 11th, 2008, 02:55 PM
ios_base::binary can be quite confusing and I know I was caught out at first. I also expected that if I set the stream to binary it would put the numbers in in a binary format. I also thought the API...
|
Click Here to Expand Forum to Full Width
|