3. Multi-line Cheng, and tuple arrays

Source: Internet
Author: User

1#include <Windows.h>2#include <thread>3#include <iostream>4#include <tuple>5 using namespacestd;6 7 voidRun ()8 {9MessageBox (0, L"Hello", L"Hello",0);Ten } One  A voidRunA (Constwchar_t *s,Constwchar_t *b) - { -MessageBox (0, S, B,0); the } -  - classMyClass - { +  Public: -     void operator()()//C + + overloading +     { AMessageBox (0, L"Hello", L"Hello",0); at     } - }; -  - voidmain1 () - { -Thread t1[3]{thread (run), Thread (run) , Thread (Run)}; in  -Thread *P1 =Newthread (run); toThread *P2 =Newthread (run); +  -Thread *p (Newthread[3]{thread (run), Thread (run) , Thread (Run)}); the     //pseudo function *Thread t3[3]{Thread (MyClass ()), Thread (MyClass ()), Thread (MyClass ())}; $System"Pause");Panax Notoginseng } -  the voidMain () + { A     //Multithreading with Parameters theThread T1 (RunA, L"Wood man 1", L"HELLO"); +Thread T2 (RunA, L"Wood man 1", L"HELLO"); -thread t3 (RunA, L"Wood man 1", L"HELLO"); $  $     //tuple Array -     CharCH ='X'; -      ShortSH =129; the     intnum =1234; -     Char*p ="Wood man";Wuyituple<Char, Short,int,Char*>mytuple (CH, SH, num, p); theAuto I0 =Get<0>(mytuple); -cout << I0 <<Endl; WuAuto I1 =Get<1>(mytuple); -cout << I1 <<Endl; AboutAuto I2 =Get<2>(mytuple); $cout << i2 <<Endl; -Auto i3 =Get<3>(mytuple); -cout << i3 <<Endl; -Cin.Get(); A}

3. Multi-line Cheng, and tuple arrays

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.