1#include<stdio.h>
2#include<string.h>
3
4
5int main()
6{
7
8 char char1[] = "coucou";
9 char char2[] = "coucou";
10
11 if( strcmp(char1, char2) == 0 )
12 printf("Strings are the same");
13
14 else
15 prinf("Strings are differentes");
16
17
18 return 0;
19}
1Good Website to learn:
2https://en.cppreference.com/w/cpp/container
3https://www.cplusplus.com/reference/stl/
4https://www.geeksforgeeks.org/the-c-standard-template-library-stl/
1#include <bits/stdc++.h>
2#include <iostream>
3#include <map>
4using namespace std;
5void mapDemo(){
6 map<int, int> A;
7 A[1] = 100;
8 A[2] = -1;
9 A[3] = 200;
10 A[100000232] = 1;
11 //to find the value of a key
12 //A.find(key)
13
14 //to delete the key
15 //A.erase(key)
16
17 map<char, int> cnt;
18 string x = "Sumant Tirkey";
19
20 for(char c:x){
21 cnt[c]++;//map the individual character with it's occurance_Xtimes
22 }
23
24 //see how many times a and z occures in my name
25 cout<< cnt['a']<<" "<<cnt['z']<<endl;
26
27}
28
29int main() {
30 mapDemo();
31 return 0;
32}
1int strcmp ( const char * str1, const char * str2 );
2
3// returning value | indicates
4// <0 the first character that does not match has a lower value in ptr1 than in ptr2
5// 0 the contents of both strings are equal
6// >0 the first character that does not match has a greater value in ptr1 than in ptr2
7