New member
- Joined
- Feb 1, 2023
- Messages
- 18
- Thread Author
- #1
I have this defined struct:
For the the node one it is Ok, but for the List one I have a declaration error in visual studio (2022), I am new to C, how to declare default values in C structs?
Code:
#include <stdio.h>
#include <stdlib.h>
typedef struct Node {
int data;
struct Node* prev;
struct Node* next;
} Node;
typedef struct List {
int size = 0;
Node* head = NULL;
Node* tai = NULL;
} List;
List* list1;
For the the node one it is Ok, but for the List one I have a declaration error in visual studio (2022), I am new to C, how to declare default values in C structs?