Linked List

Hi I Could use some help creating a linked list that continues to create nodes until instructed otherwise. I'm not sure exactly how to set them up. (Car is the name of the struct).

1
2
3
4
5
6
7
8
9
10

int main (){
   bool complete = false;
   Car *head = NULL, *current = NULL;
   head = new Car;
   head->next = current; 
   while (!complete) {
     
   }
}
closed account (48T7M4Gy)
1
2
3
4
5
6
7
8
9
10
while (!complete) {

//Create a new node
//Ask" do you want to continue y/n ?"
//if answer is y
//   complete = false
//else
//   complete = true

}
Topic archived. No new replies allowed.