I am doing hash implementation. I have sample program below.
#define HASHSIZE 25
struct HashTable {
char key[50];
char val[50];
};
int main() {
struct HashTable *hashtab[HASHSIZE]; // declaration - 1
struct HashTable hashtab2[HASHSIZE]; // declaration - 2
}
declaration-1:
struct HashTable *hashtab[HASHSIZE];
declaration-2:
struct HashTable hashtab2[HASHSIZE];
As per my understanding, both declarations are seems to be doing same in memory layout of allocation. Like, allocating HASHSIZE of array of struct HashTable and variable pointing to the [0]th element of array of structs.
But, Still I feel that there is some difference that I might not be able to get it.
I want to know if there is a difference, how does one differ from another in memory layout (OR) allocation/accessing.