Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
hgh
#include <iostream> using namespace std; class LinkedList; class Node { friend class LinkedList; private: int data; Node *next; }; class LinkedList { private: Node *head; public: LinkedList { head = 0; } ~LinkedList { Node *curr = head; Node * prev; while(curr!=0) { temp = curr->next; delete curr; curr = temp; } head = 0; } bool InsertAtStart(int val) { Node *temp = new Node; if(temp!=0) { temp->data = val; temp->next = 0; head = temp; return true; } else { return false; } } void display() { Node *curr = head; while (curr!=0) { cout << curr; curr = curr->next; } } }; int main() { cout << "Hello World" << endl; }
run
|
edit
|
history
|
help
0
Number of paths in matrix
Test
#9
std override
infix to postfix v 3.0
Wide string conversion with multibyte chars
😊
VC++ error C2440 with combined use of non-type template parameters
Default constructor - deleted
virtual inheritance