I am trying to access a member of structure 'Word' through another structure 'Dict' using double pointer ** but getting 'access violation' error in visual studio 2010. I checked link "accessing double pointer to structure" also on stackoverflow but its also not resolving the issue. Can somebody please help me identifying the error in the code? I am inlining the code here:
============================================
#include <iostream>
#include <stdlib.h>
#include <time.h>
//#include "dict.h"
using namespace std;
enum WordType{All, Animal, Fruit, Name};
struct Word{
WordType type;
char word[20];
};
struct Dict{
int size;
int capacity;
Word **wordArray;
};
int main() {
Dict *dic = new Dict;;
dic->size=0;
dic->capacity=0;
strcpy((dic->wordArray[0])->word,"hi");
cout<< (dic->wordArray[0])->word;
system("pause");
return 0;
}
========================================================