123456789101112131415161718192021222324252627282930313233
#include <string> #include <iostream> using namespace std; typedef string DataT; struct link; struct link{ struct link *next; struct link *prev; DataT data; }; struct list{ struct link *head; }; typedef struct link LinkT; typedef struct list StrLLT; typedef struct link *Iter; StrLLT *Cons(void){ StrLLT *tempList; tempList = (StrLLT*)malloc(sizeof(StrLLT)); tempList->head = (LinkT*)malloc(sizeof(LinkT)); tempList->head->next = NULL; tempList->head->prev = NULL; tempList->head->data = "sr"; //Offending Line of Code return tempList; };