The method of forcing removal of transferred characters and The imitation function

Source: Internet
Author: User


#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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.