私はC++を全く新しくしています。私は3つのノードを持つ単純なリンクリストを実装しようとしています。ここに私のコードです:C++でリンクされたリストの問題
#include<iostream>
using namespace std;
struct node(){
int data;
struct node* next;
};
struct node* BuildOneTwoThree() {
struct node* head = NULL;
struct node* second = NULL;
struct node* third = NULL;
head = new node;
second = new node;
third = new node;
head->data = 1;
head->next = second;
second->data = 2;
second->next = third;
third->data = 3;
third->next = NULL;
return head;
};
明らかに、なぜコンパイルされていないのですか? :(
は、任意の助けを事前にありがとうございます!
コンパイラのエラーメッセージとは何ですか? –
もしあなたが「全く新しい」ならば、あなたはまだチャンスがある間にあなたの心の中から 'abusing namespace std;'を削除し、もう一度使ってはいけません。 –
エラーメッセージのコピーは次のとおりです。http://chopapp.com/#fq7vcb86 –