Search:

Type: Posts; User: P3nGu1N

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,263

    good call, thanks.

    good call, thanks.
  2. Replies
    2
    Views
    1,263

    Different string comparison question

    I cannot seem to match up the strings when looking for them in my SymTab. I know the hash function works and will always hash the name to the correct location, so it must be something semantic I'm...
  3. Replies
    11
    Views
    1,915

    Re-read my assignment sheet, and it does seem to...

    Re-read my assignment sheet, and it does seem to want all coding in a separate SymTab.c file. I duplicated my folder, just in case something bad happened when I transferred all the methods over, but...
  4. Replies
    11
    Views
    1,915

    but the .c file is the driver my professor gave...

    but the .c file is the driver my professor gave me. I assumed he wanted all of the coding done in the .h file.

    Thanks for the explanation, it makes sense that it has to be declared before use.
  5. Replies
    11
    Views
    1,915

    Alright, put it at the top of my SymTab.h and got...

    Alright, put it at the top of my SymTab.h and got a clean compile.

    Okay, so now I'm really confused why my other methods all compiled, but not this one without a prototype.
    Should I have...
  6. Replies
    11
    Views
    1,915

    do you mean something like this before the...

    do you mean something like this before the method?


    struct SymEntry * FindName(struct SymTab *ATable,
    const char * Name);

    or, what do you mean by 'prototype'?
  7. Replies
    11
    Views
    1,915

    More Compiler Errors...

    Yes, I'm still having problems coding my SymTab.h file.

    Here is what the compiler is giving me:

    SymTab.h: In function 'EnterName':
    SymTab.h:137: warning assignment makes pointer from integer...
  8. double percent needs a semicolon - double...

    double percent needs a semicolon -


    double percent;

    if (sum==8
    eight++);

    should probably be
  9. Replies
    31
    Views
    7,385

    ;

    ; <- also, what is this??!!

    that is a semicolon. (Yeah you probably knew that, but you can also end your methods with them. It doesn't matter whether it's there or not, just different style of...
  10. Replies
    31
    Views
    7,385

    That's true, but how do I access the previous...

    That's true, but how do I access the previous SymEntrys in the list after I destroy the last one? I was trying that outer while loop to destroy the last one, then the new last one, until the first...
  11. Replies
    31
    Views
    7,385

    What I'm trying to do is free the contents of a...

    What I'm trying to do is free the contents of a list of SymEntry s in the array associated with Contents of a SymTab. If I can't use a pointer, p to point to the address location where each SymEntry...
  12. Replies
    31
    Views
    7,385

    The sad thing is I've already created this...

    The sad thing is I've already created this program in Java last year. It's much easier for me to look at abstract data types like chain bucket hashing from an object oriented language.
  13. Replies
    31
    Views
    7,385

    you made a very valid point... I'm really just...

    you made a very valid point... I'm really just trying to destroy each list item in an array of lists, which means I should only have to access each Contents[i] once provided it wasn't NULL to begin...
  14. Replies
    31
    Views
    7,385

    Well, I've known '\0' == NULL, but 0 == NULL? I...

    Well, I've known '\0' == NULL, but 0 == NULL? I miss programming in Java...
  15. Replies
    31
    Views
    7,385

    Alright, just tried this: void...

    Alright, just tried this:


    void DestroySymTab(struct SymTab *ATable) {
    int i;
    struct SymEntry *p;

    for (i = 0; i < ATable->Size; i++) {
    while(ATable->Contents[i] != NULL) {
    /*p =...
  16. Replies
    31
    Views
    7,385

    Alright, well it keeps spitting out address:0 in...

    Alright, well it keeps spitting out address:0 in the console, let me try the Contents[i] alone one for you.
  17. Replies
    31
    Views
    7,385

    Shouldn't Contents[i] be set to NULL when I set...

    Shouldn't Contents[i] be set to NULL when I set the pointer p to NULL when it's pointing to it?

    Okay, trying the other suggestion, bbs.
  18. Replies
    31
    Views
    7,385

    Tried it, and nope the infinite loop is in the...

    Tried it, and nope the infinite loop is in the outer while statement.


    void DestroySymTab(struct SymTab *ATable) {
    int i;
    struct SymEntry *p;

    for (i = 0; i < ATable->Size; i++) {...
  19. Replies
    31
    Views
    7,385

    Well, right now for testing purposes I haven't...

    Well, right now for testing purposes I haven't implemented adding anything past one name, and SymEntry->Next should be NULL terminated for that one.


    bool EnterName(struct SymTab *ATable, const...
  20. Replies
    31
    Views
    7,385

    Infinite Loop in Destructor...

    Shouldn't this become NULL and exit the loop? It certainly doesn't...


    void DestroySymTab(struct SymTab *ATable) {
    int i;
    struct SymEntry *p;

    for (i = 0; i < ATable->Size; i++) {...
  21. Replies
    11
    Views
    34,942

    odd, it compiled this time with: ...

    odd, it compiled this time with:


    free(ATable);

    Might have just been the iMac version of gcc that didn't like it? I just tried on my Window's downloaded version of gcc... Well, thanks for...
  22. Replies
    11
    Views
    34,942

    alright, maybe I should post my constructor to...

    alright, maybe I should post my constructor to clarify things:



    struct SymTab * CreateSymTab(int Size) {
    int i;

    if( Size > 0){
    tableSize = Size;
    }
  23. Replies
    11
    Views
    34,942

    using free() with structs

    I'm new to the board, so first - hi.

    I'm also fairly new to C programming, but have a good background in Java and a little C++.

    There's part of a program that I'm stuck on how to do:


    ...
Results 1 to 23 of 23