Uninitialized local variable??

This is probably just a stupid mistake that I made that I don't know how to fix...it says this about 'X' and 'operation'...any help would be appreciated thanks.
heres the code:

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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include <iostream>
#include <cmath>
using namespace std;

void main()	{
	double number, number1, sum = 0.0, sum1 = 0.0;		
	char X, operation;							

	while (operation != 'X')
	{
		cout<<"Enter the operation you wish to compute:\n+ for addition\n- for subtraction\n^ to raise a number to a power\ns for square root\n* for multiplication\n/ for division\nenter 'X' to exit the program\n";
		cin>>operation;							
	
		switch (operation)
		{
			case '+':	cout<<"Enter the number you wish to add, enter 'X' to finish: ";
						cin>>number;

						while (number=X)	{
							break;
						}
						while (number != X)	{
							sum = sum1 + number;

							cout<<"Enter the number you wish to add, enter 'X' to finish: ";
							cin>>number;
						}
						cout<<"The sum of the numbers you entered is "<<sum<<".\n";
						break;
	
			case '-':	cout<<"Enter the number you wish to subtract from, enter 'X' to finish: ";
						cin>>number1;

						while (number != X)	{
							sum = number1-number;

						cout<<"Enter the number you wish to subtract, enter 'X' to finish: ";
						cin>>number;
						}
						cout<<"The difference of the numbers you entered is "<<sum<<".\n";
						break;

			case '*':	cout<<"Enter the number you wish to multiply, enter 'X' to finish: ";
						cin>>number1;

						while (number!= X)	{
							sum= number1*number;

							cout<<"Enter the number you wish to multiply, enter 'X' to finish: ";
							cin>>number;
						}
						cout<<"The product of the numbers you entered is "<<sum<<".\n";
						break;

			case '/':	cout<<"Enter the number you wish to divide, enter 'X' to finish: ";
						cin>>number1;

						while (number!= X && number1!= X && number!=0)	{
							sum=number1/number;

						cout<<"Enter the number you wish to divide by, enter 'X' to finish: ";
						cin>>number;
						}
						cout<<"The quotient of the numbers you entered is "<<sum<<".\n";
						break;

			case '^':	cout<<"Enter the number you wish to raise to a power, enter 'X' to finish: ";
						cin>>number1;

						while (number1!= X && number!= X)	{
							sum= pow(number1, number);

						cout<<"Enter the power you wish to raise the value to, enter 'X' to finish: ";
						cin>>number;
						}
						cout<<"The value of "<<number1<<"to the "<<number<<" is "<<sum<<".\n";
						break;

			case 's':
			case 'S':	cout<<"Enter the number you wish to take the square root of, enter 'X' to finish: ";
						cin>>number;

						while (number!= X)	{
							sum= sqrt(number);
						}
						cout<<"The square root of "<<number<<" is "<<sum<<".\n";
						break;

			case 'x':
			case 'X':	break;

			default:	cout<<"Are you sure this is what you want to do?";
						break;
		}
	}
}
This program is supposed to compute basic calculator functions and I am realizing more and more as I get it closer to running that it has many more issues than just the 2 i posted about... the problem with 'X' i have already solved
Line 7 char X, operation;

You haven't given these a default initialisation value. It's only a compiler warning, not an error. But can be corrected with.

char X = 0, operation = 0;
Topic archived. No new replies allowed.