#include <iostream>
#include <functional>
using namespace Std;
Using namespace std::p laceholders;
Ways to remove a transfer character
void Main ()
{
For example, I want to open the door QQ
First Kind
String str = "C:\Program Files\qq\bin\qq.exe";
System (STR.C_STR ());
There's a transfer character, is it a pain in the egg?
Next we force the escape character to be removed
R "()" can force the removal of parentheses to remove the character is not that cool
String str2 =r "(" C:\Program Files\qq\bin\qq.exe ")";
System (STR2.C_STR ());
Cin.get ();
}
struct MYSTRUCT
{
void Add (int a)
{
cout << a << Endl;
}
void Add2 (int a, int b)
{
cout << A + b << endl;
}
void Add3 (int a, int b,int c)
{
cout << A + b+c << Endl;
}
};
This is an imitation function.
void Main23 ()
{
MyStruct Struct1;
Auto Func = bind (&mystruct::add, &struct1,_1); function pointers directly with someone else's member function
Parameter and instantiation plus the number of arguments can be bound
Func (100); Fun is a function pointer
Auto Func2 = bind (&mystruct::add2, &struct1, _1,_2);//indicates placeholder
FUNC2 (100, 20);
Auto func3 = bind (&mystruct::add3, &struct1, _1, _2, _3);
FUNC3 (10, 20, 50);
void (mystruct*p) (int a) = &MyStruct::add;
Cin.get ();
}
The method of forcing removal of transferred characters and The imitation function