#include<iostream>
#include<stdlib.h>
#include<conio.h>
#include <ctime>
#include <fstream>
#include <windows.h>
#include <string>
using namespace std;
/* data variable is used to store data as name
suggests,the "next" is a pointer of the type node
that is used to point to the next node of the
Linked List*/
/*
* Node Declaration
*/
struct node
{
string info;
struct node *next;
}*start;
/*
* Class Declaration
*/
class single_llist
{
public:
node* create_node(string);
void insert_begin();
void insert_pos();
void insert_last();
void delete_pos();
void sort();
void search();
void update();
void reverse();
void display();
single_llist()
{
start = NULL;
}
};
/*
* Inserting element in beginning
*/
void single_llist::insert_begin()
{
string value;
cout<<"Enter the value to be inserted: ";
cin>>value;
struct node *temp, *p;
temp = create_node(value);
if (start == NULL)
{
start = temp;
start->next = NULL;
}
else
{
p = start;
start = temp;
start->next = p;
}
cout<<"Element Inserted at beginning"<<endl;
}
をして文字列ノードの定義はthem.Therefore私はプログラムがこれを与えstring.Theを扱っていますエラー:undefined reference to single_llist::create_node(std::string)
ここに間違いがあることを私に見せてください。temp = create_node(value);
この問題を解決するために何をする必要があるのか、まだ研究していますか?リンクリスト私はDevのC++ program.Iはtxtファイルに特定の単語を入力しようとして保存すると、私のプログラムを開発してい
'create_node'関数を定義しましたか? – NathanOliver