converting Char with ASCII

so i converted a letter to int using ASCII
via (int=char)
my example is in my menu()
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
void LList::Menu(){
        //This displays the vigesimal number that is current. then ask
        //for a user input.

        char useranswer;
        int answer;

        answer=0;


        cout<<"Current vigesmial number is:   ";
        Print();
        cout<<endl;

        cout<<endl;
        cout<<"Command (h for help) : ";
        useranswer=Read_element();
        answer=useranswer;


        if ((answer == 101) || (answer == 69))
                Vigesimalinput();
        else if ((answer == 97) || (answer == 65 ))
                AddVigesimal();
        else if ((answer == 109) || (answer == 77 ))
                MultiplyVigesimal();
        else if ((answer == 104) || (answer == 72))
                HelpMenu();
        else if ((answer == 113) || (answer == 81))
                Menu();
        else
                cout<<"Invalid menu option (h for help)""\n"<<endl;
                Menu();
        }


then in my print() i'm totally dropping the ball
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void LList::Print(){
        //Pre; The N.O LList is valid
        //Post: the N.O LList is unchaged and its elements have been
        //      displayed 

        char letter;
        int val;
        listnode* temp;

        temp=head;

        while(temp != NULL){
                temp=val;
                temp=letter;
                cout<<temp -> data;
                temp=temp -> next;              //pointer increament
                }
        }


so my head wanted to just use
temp=letter
but since temp is a listnode* and not an int it does not convert
Topic archived. No new replies allowed.