-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemp.cpp
More file actions
33 lines (26 loc) · 658 Bytes
/
Copy pathtemp.cpp
File metadata and controls
33 lines (26 loc) · 658 Bytes
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
#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
int main(){
char test[80], blah[80];
char *sep = " ";
char *substring;
strcpy(test, "copy file1 file2");
//string test="sadlfjsadf sdaflj";
int i=0;
for (substring = strtok(test, sep); substring; substring = strtok(NULL, sep), i++)
{
if(i==0){
cout << " cmd " << substring;
}
else if (i==1){
cout << " 1 " << substring;
}
else if(i==2){
cout << "2 " << substring;
}
//printf("So far we're at %s\n", substring);
}
return 1;
}