-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountrepeatCharInWord.cpp
More file actions
57 lines (47 loc) · 957 Bytes
/
CountrepeatCharInWord.cpp
File metadata and controls
57 lines (47 loc) · 957 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
using namespace std;
void print(const std::string& infix, const std::string& comp)
{
int count = 0;
for (auto c = infix.begin(); c!=infix.end(); ++c)
{
if (*c == 'm') {count++; std::cout << (int)(*c) << std::endl;}
}
cout << "count: " << count << std::endl;
}
int main()
{
string strf = "mamadou";
string strl = "saliou";
//int a = strf.length();
//cout << a << endl;
print(strf,strl);
return 0;
}
/*
int i = 0;
while (strf[i] != '\0')
{
++i;
}
cout << i << endl;
// 5. size of string object using for loop
for (i=0; strf[i]!='\0'; i++)
{
}
cout << i << endl;
std::cout << "Printable ASCII:\n";
for (char i = 32; i < 127; ++i)
{
std::cout << i << ' ';
if (i % 16 == 15)
std::cout << '\n';
}
int b = ' ', c = ' ';
cout << b * c << endl;
int var=65;
cout<<(char)var<<endl;
*/