declare a structer in cpp code example
Example: declare a structer in cpp
// Definition for singly-linked list.
struct SinglyListNode {
int val;
SinglyListNode *next;
//Constructor
SinglyListNode(int x) : val(x), next(NULL) {}
};
// Definition for singly-linked list.
struct SinglyListNode {
int val;
SinglyListNode *next;
//Constructor
SinglyListNode(int x) : val(x), next(NULL) {}
};