char and more

I'm trying to get the hang of the declaration and use of char. I'm trying to write a program that reads sentences from the user and changes them based on their character choices, I keep getting a buttload of compiler errors.......am I off to a good start or am I way off?
#include<iostream>
#include<string>
#include<cstring>
#include<cctype>
using namespace std;

int main()
{
char *quit*;
char sentance [100];
cout << "Welcome to editor. Please enter your first sentance or *quit* to end." <<endl;
cin >> sentance >>endl;
if (sentance = *quit*)
{
return 0;
}
else
{
cout << "We're gonna have a little fun.\n Im going to give you three choices.\n Each one of these will alter a sentance in a different way." <<endl;
cout << "Enter H for option 1, R for option 2, or U for option 3" <<endl;
{
char replace;
char reverse;
char change;

if ()
{
}
else if ()
{
}
else if ()
{
}
}

return 0;
}

Could you copy and paste the exact "butload of compiler errors"?

Right off the bat I notice you have an extra asterisk after "char *quit;"
Last edited on
I changed the code a bit and got farther .....sorry to sound stupid but I am very new to this and I'm trying everything I can read in my book and online.
It compiled when I changed the code to this:

#include<iostream>
#include<string>
#include<cstring>
#include<cctype>
using namespace std;

int main()
{
char quit;
char sentance [100];
cout << "Welcome to editor. Please enter your first sentance or *quit* to end." <<endl;
cin.get();

if (quit = )
{
return 0;
}
else
{
cout << "We're gonna have a little fun.\nIm going to give you three choices.\nEach one of these will alter a sentance in a different way." <<endl;
cout << "Enter H for option 1, R for option 2, or U for option 3" <<endl;
{
char replace;
char reverse;
char change;

}
return 0;
}
}
Your code clearly indented and wrapped in code tags...

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
#include<iostream>
#include<string>
#include<cstring>
#include<cctype>
using namespace std;

int main()
{
	char quit;
	char sentance [100];
	
	cout << "Welcome to editor. Please enter your first sentance *quit* to end." <<endl;
	cin.get();

	if (quit = )
	{
		return 0;
	}
	else
	{
		cout << "We're gonna have a little fun.\nIm going to give you three choices.\nEach one of these will alter a sentance in a different way." <<endl;
		cout << "Enter H for option 1, R for option 2, or U for option 3" <<endl;
		{
			char replace;
			char reverse;
			char change;

		}
		return 0;
	}
}
Last edited on
Topic archived. No new replies allowed.