Where does this go?

Here is what I am trying to accomplish.
Add a while loop to display characters A-C

here is my 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
//

#include <iostream>

using namespace std;
struct Node
{
    char letter;
    Node *next;
};



int main()
{
    Node *head;
    Node *tail;
    Node *newNode;

    newNode = new Node;
    newNode->letter = 'A';
    newNode->next = NULL;

    head = newNode;
    tail = head;

    newNode = new Node;
    newNode->letter = 'B';
    newNode->next = NULL;

    tail->next = newNode;
    tail = newNode;

    newNode = new Node;
    newNode->letter = 'C';
    newNode->next = NULL;

    tail->next = newNode;
    tail = newNode;
    //Add a while loop to display characters A-C.


    system("pause");
    return 0;
}


Here is the while loop that I need to put into my code, but I can not figure out where to insert this so that I can display characters A-C.
1
2
3
4
5
while (head != NULL)
{
   cout<<head->letter<<endl;
   head = head->next;
}


Please help. This is the last project that i have to complete and I have been going crazy trying to get it done. If someone could complete this i would be very grateful. I know I have everything just don't know how to make the puzzle pieces fit.

line 40: //Add a while loop to display characters A-C.
Hmm.If I Were You,I Would Include <string.h> And Then Assign A Number To Each Letter.For Bigger Loops,I Would Make A Loop That Would Assign Each Other.Now That Would Be Simple(:.I Am Not The Best At Syntax,But I do Program The Following Languages.No Joke:JavaScript,HTML,VBS,BASIC,CSS,Lua,Luna,And After Mastering All Of The Above (I am Woriking On BASIC And C++)I think I know what do Do Command Wise.
Topic archived. No new replies allowed.