When creating a new node in a linked list, is it legal to use designated initializers to initialize the members of the node as mentioned below? Is there any repercussion in doing so and what would be a better way to achieve the same result? (lang : C++)
Node *temp = new Node{.data = value, .next = NULL};
struct Node
{
int data;
Node *next;
};