Help with alphabetical names

I stuck on how to out the first name enter lexographically. Im suppose to write a string function begin that sends the output to main. Any help would be appreciated.



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
#include <iostream>
#include <string>

using namespace std;

void begin (string nameA, string nameB)

{
	nameA = 
	nameB =
	

	if (nameA < nameB ||  nameA == nameB)
	{
		cout<<name1;
	}
	else if (nameB > nameA)
	{
		cout<<name2;
	}
	else if (nameB == nameA)
	{
		cout<<name3;
	}
	else
	{ 
		cout<<name4;
	}
	
	void charfunct(string name1, string name2, string name3, string name4)
		

int main()
{
	
	

	string name1, name2, name3, name4; 

		cout<<"Please enter name 1: ";
		cin>> name1;
		cout<<"Please enter name 2: ";
		cin>> name2;
		cout<<"Please enter name 3: ";
		cin>> name3;
		cout<<"Please enter name 4: ";
		cin>> name4;
		
		cout<<before<<endl;

}
Topic archived. No new replies allowed.