Search:

Type: Posts; User: eeeeej

Search: Search took 0.01 seconds.

  1. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    Im not sure how to deal with entries that dont...

    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?
  2. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    it is getting stuck when there is an entry with...

    it is getting stuck when there is an entry with no comma in their name like NSYNC
  3. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    OK I think it is initializing now. Hoewever if I...

    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));
    ...
  4. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    Well that seems to have stopped the error on...

    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!!
  5. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    IMDB size is #define IMDBSIZE 119467 ...

    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...
  6. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    Yeah I tried removing that. still erroring out....

    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 ==...
  7. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    I decalre Table T; then call the function ...

    I decalre Table T;

    then call the function
    Initialize(T);

    and have the allocated memory in the header file
    typedef TableEntry Table[TableSize];
  8. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    well when I call it I just do ...

    well when I call it I just do


    Initialize(T);


    as its a function....?
  9. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    typedef char KeyType[200]; typedef struct {...

    typedef char KeyType[200];

    typedef struct
    {
    int NumberFilms;
    char* Actor;
    char** Films;
    } InfoType;

    typedef struct
  10. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    Thanks for your replies so far you're being very...

    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;

    //...
  11. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    for (j=0;j

    for (j=0;j<50;j++)
    {
    T[i].Info.Films[j] = calloc(50, 200);
    strcpy(T[i].Info.Films[j],"hhh");
    }
  12. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    thanks for the reply. Tried that and yeh it did...

    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,...
  13. Thread: Initialising

    by eeeeej
    Replies
    24
    Views
    7,292

    Initialising

    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...
Results 1 to 13 of 14