Answer by David C. Rankin for Initialize recursive struct type in C properly
While Akira has a very good answer for you (I voted for it), I would caution you about typedeffing pointers. Why? As your projects grow, when you start hiding levels of indirection behind a typedef,...
View ArticleAnswer by Akira for Initialize recursive struct type in C properly
You can do it as follows:#include <stdio.h>typedef struct _date { char d[11], t[6], s[4]; // +1 to size for null-terminator ('\0') struct _date *next;} *date;int main() { struct _date a = {...
View ArticleInitialize recursive struct type in C properly
I am new to C programming and I have the following struct:typedef struct _date { char d[10], t[5], s[3]; struct _date *next;} *date;How can I properly create an instance of this?My solution:date...
View Article
More Pages to Explore .....