-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
65 lines (45 loc) · 1.11 KB
/
Copy pathmain.cpp
File metadata and controls
65 lines (45 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
name: keyvan shellscript
version:0.1
you can use this script in linux and windows but defult in windows
*/
//this is library to use
#include <iostream>
#include <string>
#include <vector>
#include <thread>
//this is name space to use
using namespace std;
//this is test metohd
void sum(int x, int y){
cout << x + y << endl;
}
//this is method to run app
void run(string cmd){
//for convert string to char
const char* com = cmd.c_str();
system(com);
}
//this is main method
int main(){
//this is test to app work
vector<int> temps;
int temp;
for(int i = 0; i < 5; ++i){
temp = i;
temps.push_back(temp);
}
cout << temps[2] << endl;
cout << temps[3] << endl;
cout << temps.front() << endl;
sum(temps[2],temps[3]);
string filename;
cout << "enter the file name:" << endl;
cin >> filename;
string cmd = "./" + filename;
//run thread to speed and run is function and names and formats is parametr
thread t1(run,cmd);
t1.join();
//I use return 0 for version 0.1
return 0;
}