C Plus Plus Implementation of Linked List

C Plus Plus Implementation of Linked List

Instructor-svgAl-Mamun Sarkar
Apr 16 , 2020

C Plus Plus Implementation of Linked List. The following code shows how to implement linked list using the C++ programming language.

 

Code:

#include<iostream>
using namespace std;

struct Node
{
    int data;
    Node* link;
};

int main()
{
    Node *A = NULL;

    Node* temp = new Node();
    temp->data = 2;
    temp->link = NULL;
    A = temp;

    temp = new Node();
    temp->data = 4;
    temp->link = NULL;


    Node* temp1 = A;

    while (temp1->link != NULL) {

    }


    return 0;
}

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram