system("cls") ... ? Or you mean clear screen functions which will adapt to all systems which the program will run ... How possible is that?
Printable View
There is (on ALMOST all systems) a way to clear the screen from inside an application - calling system is DEFINITELY one of the worst possible solutions from all aspects except independence of the compiler specifics.
There was a post in the other thread about how you do it on Windows. For Linux, there are different solutions.
You may also want to look into curses (dpcurses for example), which is a portable [as in, it implements a bunch of different sets of functions that are system dependant, and when building the library, chooses the one that is correct for the particular system].
If you don't use curses, and what portability, you will need to use a similar mechanism - often you'd have a "windows_screenfuncs.cpp" and "linux_screenfuncs.cpp" or some such. Both of these will have the system specific functions that you need, such as clrscr() implemented - the implementation being different of course.
--
Mats
Downloaded pdcurses, just by including <curses.h>, i get strange compile warnings & errors...
some here ..
etc... :(Code:warning C4005: 'MOUSE_MOVED' : macro redefinition
error C2059: syntax error : '('
error C2039: 'usr_iter' : is not a member of 'std::vector<_Ty>'
error C2668: 'std::vector<_Ty>::end' : ambiguous call to overloaded function
A delegate in the C# sense is a member function pointer. In C++ a delegate could mean several different things. The term "function object" or "functor" is more common in the C++ world.
The advantage to a functor is that it can carry additional information that helps to make the call. A method pointer is just a pointer to a function to call -- if that function takes any parameters (and it always takes at least one, the "this" pointer), these need to be stored somewhere so they can be passed when the function is called. That's what the functor takes care of.
It's a bound function pointer - could be a member function bound to an object, or a free (or static member) function bound to nothing.Quote:
A delegate in the C# sense is a member function pointer.