|
are you trying to add a member function to an existing class? (you can't do that in C++)
|
|
|
|
|
Check the way you've typedeffed the Match member function pointer, you've got the asterisk in the wrong place.
A pointer to a member function of A which takes a B as a parameter and returns a C is declared as:
C (A::*funct)( B );
So change your typedef to the same style and you're good to go!
Cheers,
Ash
|
|
|
|
|
how to use a linked list to store all data of clients connected to server???????????
|
|
|
|
|
I think point 2 from this[^] link is helpful for you.
|
|
|
|
|
|
Member 8771416 wrote: ...all data of clients connected to server??????????? Really?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
What data are you trying to store? What about a linked lists don't you understand? Your question is vague... need to rephrase.
|
|
|
|
|
I want to put text and image in Windows Clipboard with MFC. For example, put two lines of text and three other pictures.
Anyone can help me?
Thank you in advance!
|
|
|
|
|
You will probably need to create some form of memory structure containing your data and use a Registered Clipboard Format[^] to identify it.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Dear All,
How do I know the Mfc Lib files referring MFC dll.
Ex : knowing MFC42D.dll referencing LIB files.
|
|
|
|
|
It is common practice to give the library file the same name as the DLL file. So the libary file for MFC42D.dll will be MFC42D.lib.
|
|
|
|
|
Should be easy, you won't even get to the dll linking stage (which happens after compilation) if you don't have the necessary lib files included for the linker, so you'll get an error.
...and like Jochen already mentioned, it's customary to keep the same name.
|
|
|
|
|
except the "gethostbyname"function way,,Thanis in advance
|
|
|
|
|
You might need to ask your question again. gethostbyname function retrive the ip using host name such as "www.google.com". If i am not mistaken this ip is retrieved from DNS server. if you dont have a DNS server IP but another name you may not be able to connect with internet
|
|
|
|
|
You may use the getaddrinfo() function [^].
|
|
|
|
|
In file atldef.h
#ifndef ATLASSUME
#define ATLASSUME(expr) do { ATLASSERT(expr); __analysis_assume(!!(expr)); } while(0)
#endif // ATLASSERT
I do not know why use do{} while(0), not { }.
|
|
|
|
|
Because its not while iteration it do-while iteration.
you must need to know the structure of do-while
the structure is
do
{
...
...
}while(condition);
the basic difference between while loop and do-while is
in case of while loop first it will check for condition. if it is not true statements in the while loop wont be executed.
but in case of do-while first the statement would be executed then it will check for further execution.
|
|
|
|
|
Thank you for you reply.
I know the different between do-while and while.
I do know why this Macro why not defined as following:
#define ATLASSUME(expr) { ATLASSERT(expr); __analysis_assume(!!(expr)); }
because the loop "do-while(0)" will be execute only once.
|
|
|
|
|
|
Very good answer. +5.
Thanks very much.
|
|
|
|
|
You are welcome.
Veni, vidi, vici.
|
|
|
|
|
Traitor.
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Veni, vidi, vici.
|
|
|
|
|
Some compilers may complain (warning level of course) for the semicolon after the {}. do-while does not have that problem.
|
|
|
|
|
Hi I'm trying to get this to work, but I'm not sure how to get the right syntax.
template <int N>
double array_sum(double * var[N], int n, double (*f)(double var[N])) {
double ret 0.0;
for (int i = 0; i < n; ++i) {
ret += f(args);
}
return ret;
}
double mul(double var[3]) {
return var[0] * var[1] * var[2];
}
int main() {
double * length = new double[10];
double * width = new double[10];
double * height = new double[10];
array_sum({length, width, height}, 10, mul);
delete [] length;
delete [] width;
delete [] height;
return 0;
}
The function should give the volume of the described element, but vstudio says that no template matches the given data.
Thanks in advance,
G
Hah, ok I solved it, and yeah there are some syntax arguments in this, but I'll still leave this open to the group to have fun with.
modified 11-Apr-12 20:03pm.
|
|
|
|