Screw vectors - manage your own memory and make a function that dynamically resizes an array and use that.
I don't believe in using all the standard template library crapola until you understand...
Type: Posts; User: homeyg
Screw vectors - manage your own memory and make a function that dynamically resizes an array and use that.
I don't believe in using all the standard template library crapola until you understand...
That would do nothing because the action would never be executed.
class MyClass
{
private:
UCHAR m_ucState;
BOOL (*m_myStateHandlers[3])(void);
public:
MyClass();
BOOL HandleState();
BOOL HandleState_1();
BOOL HandleState_2();
Well I wouldn't ever see a need for
for(;;);
but maybe for something like this
for(int i = 0; i<MAX; cout<<array[i++]<<endl)
;
Dev-C++ won't compile when you use
funcPtr = Blah::func;
or
myClass.*funcPtr(blah);
Blank statements are sometimes necessary.
Here's so the gurus can read the code:
template <typename Ret, Ret (torrent::Download::*func)()> void call()
{
(m_download.*func)();
}
We're talking about member functions for classes, so C is irrelevant.
Yeah if you put the parentheses around the dereferenced pointer in the call, it works.
I'm still getting an error:
#include <iostream>
using namespace std;
class CStuff
{
public:
Okay.
Lemme complete this for you (this is how you would use it):
CStuff stuff;
Pointer myFuncPtr = CStuff::Method;
stuff.myFuncPtr(5);
Repeat after me:
a b c d e f g h i j k l m n o p q r s t u v w x y z
Now try to say this:
c a t
BTW, what you are trying to do (by what you said) and what your source code shows has...
When defining a function for a templated class, is the part in bold necessary in the function header?
template <class mytype> void myclass<mytype>::myfunct(int, int)
{
//blah
}
You need to learn some damn formatting.
Also, you demonstrate a common problem with most programming noobs in which you rely on too many numbers and beat around the bush using those numbers, and...
Please give up at life now.
Dude, indentation doesn't mean crap so why tell the dude that it does?
Why not explain why that code does what it does?
Like 20 people already said the same thing before you so shut up!
I almost laughed out loud when I read that!
If you're simply just trying to return a pointer to something, and cast that return value to some other type of pointer, just return a pointer to void...
double post
Please stop trying to screw with people.
The condition in the while will never be reached because nothing ever sets the flag to true in that function.
Salem hit the nail on the head; please go read a good book on the C language, and then...
"0" would actually represent the address of that string and it is complaining because you are trying to assign the address of that string to a char variable when that variable isn't char*.
umm, learn the Win32 API? (Make some real Windows programs.) That's the only way I can think of..
Other than that, if the code is too big for your liking to go in main(), just put it in a function...
struct book
{
int page;
float price;
}b[3];
This is correct. It's just the sytax for declaring objects of the struct immediately.