Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

struct constructor in c++

# Definition of a singly linked list
struct ListNode {
	int val;	
	ListNode *next;
  
 	ListNode() : val(0), next(nullptr) {}
  	ListNode(int x) : val(x), next(nullptr) {}
 	ListNode(int x, ListNode *next) : val(x), next(next) {}
};
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #struct #constructor
ADD COMMENT
Topic
Name
4+6 =