Im not sure how to deal with entries that dont have commas in their name? ANy ideas?
if (strcspn(",", I.Actor)==0);
do this
else store the whole name?
Type: Posts; User: eeeeej
Im not sure how to deal with entries that dont have commas in their name? ANy ideas?
if (strcspn(",", I.Actor)==0);
do this
else store the whole name?
it is getting stuck when there is an entry with no comma in their name like NSYNC
OK I think it is initializing now. Hoewever if I try to do this.
for (i=0;i<IMDBSIZE;i++)
{
I.Actor = (char *) calloc(strlen(IMDB[i].actor),sizeof(char));
...
Well that seems to have stopped the error on startup. When it returns the size of T, should I use that value as the table size in #define? THanks for all your help so far. Very thankful!!
IMDB size is #define IMDBSIZE 119467
I'm not sure how large to set table size which could be causing an issue? Its defined in the header file right now.
As with table t
typedef...
Yeah I tried removing that. still erroring out. I'll try and give you some more code to see if it sheds any light as its saying stack overflow.
for (j=0;j<num_entries;j++)
{
if (j%1 ==...
I decalre Table T;
then call the function
Initialize(T);
and have the allocated memory in the header file
typedef TableEntry Table[TableSize];
well when I call it I just do
Initialize(T);
as its a function....?
typedef char KeyType[200];
typedef struct
{
int NumberFilms;
char* Actor;
char** Films;
} InfoType;
typedef struct
Thanks for your replies so far you're being very helpful. I've stared at this for so long now it just isn't going in.
void Initialize(Table T)
{
// Declare variables
int i,j;
//...
for (j=0;j<50;j++)
{
T[i].Info.Films[j] = calloc(50, 200);
strcpy(T[i].Info.Films[j],"hhh");
}
thanks for the reply. Tried that and yeh it did make more sense when I read it! I think I had been experimenting and forgot to go back. The debugger holds up on
T[i].Info.Films[j] = calloc(1,...
Hi, I am new to this board and rubbish at C so please be kind!
Im trying to initialise a hash table but am having trouble allocating memory for it. Can you please have a look and see where I've...