#include "stdafx.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <TlHelp32.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
//#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <sstream>
using std::cout;
using std::endl;
#include <vector>
typedef struct difNumStruct
{
int a;
int b;
int c;
}countModify;
void test(int &a,int &b,int &c)
{
cout<<a<<","<<b<<","<<c<<endl;
a = 11;
b = 12;
c = 13;
}
void test2(difNumStruct &t)
{
cout<<t.a<<","<<t.b<<","<<t.c<<endl;
t.a= 44;
t.b = 55;
t.c = 66;
}
void test3(std::vector<std::pair<int, std::string>> infoVector)
{
cout<<">>>>>>>>>>>>>>"<<endl;
std::vector<std::pair<int, std::string> >::iterator itr = infoVector.begin();
for(;itr!=infoVector.end();itr++)
{
std::pair< int, std::string > authorTmp = *itr;
cout << authorTmp.first<<","<<authorTmp.second<< endl;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
Rerun:
cout<<">>>>>>>>>>"<<endl;
/*int a = 1;
int b = 2;
int c = 3;
test(a,b,c);
cout<<a<<","<<b<<","<<c<<endl;
*/
/*difNumStruct d;
d.a = 3;
d.b = 4;
d.c = 5;
test2(d);
cout<<d.a<<","<<d.b<<","<<d.c<<endl;
*/
std::pair< int, std::string > author(2,"aaaaaaaaa");
cout << author.first<<","<<author.second<< endl;
std::vector<std::pair<int, std::string>> infoVec; //其他修改容器
std::pair< int, std::string > author1(30,"bbb");
std::pair< int, std::string > author2(5,"ccc");
std::pair< int, std::string > author3(7,"dd");
infoVec.push_back(author1);
infoVec.push_back(author2);
infoVec.push_back(author3);
cout<<"<<<<<<<<<<"<<endl;
test3(infoVec);
/*std::vector<std::pair<int, std::string> >::iterator itr =infoVec.begin();
for(;itr!=infoVec.end();itr++)
{
std::pair< int, std::string > authorTmp = *itr;
cout << authorTmp.first<<","<<authorTmp.second<< endl;
}*/
/*std::ostringstream oss;
std::string str="";
int a = 123456789;
oss<<a;
str +=oss.str();
cout<<str<<endl;
*/
// PROCESSENTRY32 pl[100];
// int pc;
// HANDLE hProcessSnap = NULL;
// PROCESSENTRY32 pe32 = {0};
// if (argc != 2)
// {
// cout<<"Usage\n\t ThisProgram processId"<<endl;
// return 0;
// }
// kill(4660,9);
// cout<<"kill process end"<<endl;
// ShellExecuteEx();
system("pause");
// return EXIT_SUCCESS;
// int *a = new int[1024];
// Sleep(1000);
// goto Rerun;
return 0;
}
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <TlHelp32.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
//#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <sstream>
using std::cout;
using std::endl;
#include <vector>
typedef struct difNumStruct
{
int a;
int b;
int c;
}countModify;
void test(int &a,int &b,int &c)
{
cout<<a<<","<<b<<","<<c<<endl;
a = 11;
b = 12;
c = 13;
}
void test2(difNumStruct &t)
{
cout<<t.a<<","<<t.b<<","<<t.c<<endl;
t.a= 44;
t.b = 55;
t.c = 66;
}
void test3(std::vector<std::pair<int, std::string>> infoVector)
{
cout<<">>>>>>>>>>>>>>"<<endl;
std::vector<std::pair<int, std::string> >::iterator itr = infoVector.begin();
for(;itr!=infoVector.end();itr++)
{
std::pair< int, std::string > authorTmp = *itr;
cout << authorTmp.first<<","<<authorTmp.second<< endl;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
Rerun:
cout<<">>>>>>>>>>"<<endl;
/*int a = 1;
int b = 2;
int c = 3;
test(a,b,c);
cout<<a<<","<<b<<","<<c<<endl;
*/
/*difNumStruct d;
d.a = 3;
d.b = 4;
d.c = 5;
test2(d);
cout<<d.a<<","<<d.b<<","<<d.c<<endl;
*/
std::pair< int, std::string > author(2,"aaaaaaaaa");
cout << author.first<<","<<author.second<< endl;
std::vector<std::pair<int, std::string>> infoVec; //其他修改容器
std::pair< int, std::string > author1(30,"bbb");
std::pair< int, std::string > author2(5,"ccc");
std::pair< int, std::string > author3(7,"dd");
infoVec.push_back(author1);
infoVec.push_back(author2);
infoVec.push_back(author3);
cout<<"<<<<<<<<<<"<<endl;
test3(infoVec);
/*std::vector<std::pair<int, std::string> >::iterator itr =infoVec.begin();
for(;itr!=infoVec.end();itr++)
{
std::pair< int, std::string > authorTmp = *itr;
cout << authorTmp.first<<","<<authorTmp.second<< endl;
}*/
/*std::ostringstream oss;
std::string str="";
int a = 123456789;
oss<<a;
str +=oss.str();
cout<<str<<endl;
*/
// PROCESSENTRY32 pl[100];
// int pc;
// HANDLE hProcessSnap = NULL;
// PROCESSENTRY32 pe32 = {0};
// if (argc != 2)
// {
// cout<<"Usage\n\t ThisProgram processId"<<endl;
// return 0;
// }
// kill(4660,9);
// cout<<"kill process end"<<endl;
// ShellExecuteEx();
system("pause");
// return EXIT_SUCCESS;
// int *a = new int[1024];
// Sleep(1000);
// goto Rerun;
return 0;
}