-
Notifications
You must be signed in to change notification settings - Fork 0
/
strings.cpp
45 lines (38 loc) · 990 Bytes
/
strings.cpp
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
/*Autor: Alginina Evgeniya
*Программа ищет пустые строки в файле и печатает номер строки, которые пустые.
*/
#include <iostream>
#include <fstream>
#include <thread>
#include <string>
//static const int num_threads = 10;
//void call_from_thread(int tid)
// {
// std::cout << "Launched by thread " << tid << std::endl;
// }
int main()
{
int num = 0;
std::string str;
std::ifstream ios("mass_tr.cpp");
while(ios.good())
{
num++;
std::getline(ios, str);
if (str.length() == 0)
{
std::cout << "Empty string in " << num << std::endl;
}
}
// std::thread t[num_threads];
//for (int i = 0; i < num_threads; ++i)
// {
// t[i] = std::thread(call_from_thread, i);
// }
// std::cout << "Launched from the main\n";
// for (int i = 0; i < num_threads; ++i)
// {
// t[i].join();
// }
return 0;
}