Insert a node at the head of a linked list
Insert a node at the head of a linked list
+ 23 comments Uneditable code in C# doesn't compile as it is.
solution.cs(78,36): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context solution.cs(78,36): error CS0193: The * or -> operator must be applied to a pointer Compilation failed: 2 error(s), 0 warnings
+ 20 comments Yep, the "IDE" is bugged. All codes are correct but it keeps saying:
Your Output (stdout) Right Answer!
And doesn't pass.
+ 17 comments solution.c: In function ‘main’: solution.c:111:36: error: ‘SinglyLinkedList {aka struct SinglyLinkedList}’ has no member named ‘headhead’; did you mean ‘head’? free_singly_linked_list(llist->headhead);
There is a typo in the default code and I cant edit it
+ 4 comments Node Insert(Node head,int x) {
Node node1 =new Node(); node1.data = x; node1.next= head; return node1;
}
+ 0 comments Hi,
My code is in C#:
SinglyLinkedList list = new SinglyLinkedList(); SinglyLinkedListNode node = llist;
if(node == null) { node.data = data; node.next = null; list.head = node; } else { node.data = data; node.next = llist; list.head = node; } return list.head;
I am facing compile time issue as below:
Compile Message
solution.cs(93,36): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context solution.cs(93,36): error CS0193: The * or -> operator must be applied to a pointer Compilation failed: 2 error(s), 0 warnings Exit Status
255
Please help.
Sort 800 Discussions, By:
Please Login in order to post a comment