Search:

Type: Posts; User: coni

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    2,130

    thanks for your response! unfortunately, I don't...

    thanks for your response! unfortunately, I don't have a lot of time, so I don't think I can write out all those inserting removal functions. Also, I'm avoiding creating new lists, because each of my...
  2. Replies
    1
    Views
    1,157

    please help! adding to strings

    I am trying to write to files called something that I give in my command-line. For example I call "a.out blahblah.c16", and then I want to create two new strings "blahblah.o" and "blahblah.syms" and...
  3. Replies
    3
    Views
    2,130

    problems with quicksort!

    I'm writing an inplace quicksort for linked lists, but I seem to have a bug. I don't know if it's because I changed the structure of my list, but it shouldn't be? I'm infinite looping.

    here is...
  4. Replies
    20
    Views
    7,898

    ok so I have mostly everything fixed now. I...

    ok so I have mostly everything fixed now. I realized that I had been reusing the same char array and setting pointers to it, so it changed when I read in the next word. To fix that I used a strcopy...
  5. Replies
    20
    Views
    7,898

    ok so I'm starting over and combining some code I...

    ok so I'm starting over and combining some code I wrote before:

    processLines.c (has main)


    #include <stdio.h>
    #include <ctype.h>
    #include "table.h"
    #define MAXLINELEN 100
    #define...
  6. Replies
    20
    Views
    7,898

    I think something in my printTable() is messing...

    I think something in my printTable() is messing it up:



    void printTable (struct table * symbols, FILE * out) {
    struct entry *n = symbols->first;
    printf("%s\n",...
  7. Replies
    20
    Views
    7,898

    but I haven't used malloc in this function?

    but I haven't used malloc in this function?
  8. Replies
    20
    Views
    7,898

    ok I fixed the '\0' problem by adding two more...

    ok I fixed the '\0' problem by adding two more cases:



    int processLine(char *s, int linecount, struct table *p) {
    printf("string is %s\n", s);
    char words[MAXSYMBOL];

    char* word = words;
  9. Replies
    20
    Views
    7,898

    thanks for all the help I've gotten! it's very...

    thanks for all the help I've gotten! it's very useful.

    now I'm writing a processLines that will assign each word in a line read in to addDef or addUse to add to my table.

    processLines

    ...
  10. Replies
    20
    Views
    7,898

    ok so I made all those fixes, and now I'm writing...

    ok so I made all those fixes, and now I'm writing another function addUse, which adds a node containing a number to the *occur list of entry objects to the table.



    struct table * addUse (char...
  11. Replies
    20
    Views
    7,898

    wow ok fixing the warnings seemed to have worked....

    wow ok fixing the warnings seemed to have worked. thanks!

    what do you mean I have to free the malloc? I want to add to the linked list so how else would I keep creating new nodes and add to the...
  12. Replies
    20
    Views
    7,898

    hmm I don't know if that makes a difference... I...

    hmm I don't know if that makes a difference... I was checking the addresses of the places where the first->symbol is stored, when I have this in addDef



    printf("2should be word1 %d\n",...
  13. Replies
    20
    Views
    7,898

    help with structs and malloc!

    I'm writing a header files and I must be allocating the space wrong because I'm trying to do a linked list but the nodes keep changing.

    table.h (some of these I haven't written yet)


    #ifndef...
  14. Replies
    4
    Views
    2,307

    ah ok that's what I'd thought. thanks for your...

    ah ok that's what I'd thought. thanks for your help!
  15. Replies
    4
    Views
    2,307

    ok I fixed the table.c --> table.h but now I'm...

    ok I fixed the table.c --> table.h but now I'm getting a "storage size of t isn't known" for the line "struct table t" in my tabletest.c

    I thought I had to put the struct table; line in the header...
  16. Replies
    4
    Views
    2,307

    multiple definition??

    I keep getting this error when I try to compile three files at once:
    gcc table.h table.c tabletest.c

    tabletest.c:5: warning: return type defaults to âintâ
    tabletest.c: In function âmainâ:...
Results 1 to 16 of 16