aboutsummaryrefslogtreecommitdiff
path: root/CST116F2021-Lab5/p.273.cpp
blob: 6a7d6c9533867a86dcddc3eb3194dab86bbc1764 (plain) (blame)
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
#include "Header1.h"

void GetInput(char input_1[], char input_2[])
{
	cout << "This program checks if the first six characters in a string are the same.\n";

	cout << "Please enter your first string: ";
	cin >> input_1;

	cout << "Please enter your second string: ";
	cin >> input_2;
}

void CompareInput(char comp_1[], char comp_2[])
{
	int i = 0;
	do
	{
		if (comp_1[i] == comp_2[i])
		{
			if (i < CHAR_LIMIT-1)
			{
				i++;
			}
			else if (i == CHAR_LIMIT-1)
			{
				cout << "Same.";
				i++;
			}
		}
		else
		{
			cout << "Different.";
			i = 6;
		}
	} while (i < CHAR_LIMIT);
}

//void DispResult()
//{
//
//}