Search:

Type: Posts; User: dacbo

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    2,184

    so how do i allocate space? do i need to call...

    so how do i allocate space? do i need to call calloc on it?

    also, is there any reason why the program doesnt run the whole way through

    thanks
  2. Replies
    3
    Views
    2,184

    Program Termination Problem

    I have posted about this program before and I thought I had it sorted but it appears I've run into trouble again. I'm makinga program that reads in a text file, reads it and enters all of the words...
  3. Thread: File I/O problem

    by dacbo
    Replies
    4
    Views
    1,683

    thanks for your help guys stupid mistakes on...

    thanks for your help guys

    stupid mistakes on those typos

    have since rewritten using fgetc()
  4. Thread: File I/O problem

    by dacbo
    Replies
    4
    Views
    1,683

    File I/O problem

    I'm trying to read a text file in C and insert all of the words in the file to a linked list which will then later be traversed.

    I've coded my program to take a file specified at the command line,...
  5. Replies
    10
    Views
    1,184

    yeah makes sense, cheers

    yeah makes sense, cheers
  6. Replies
    10
    Views
    1,184

    ahah, thanks very much for your help - thats done...

    ahah, thanks very much for your help - thats done it

    stupid mistake by the looks of it :)
  7. Replies
    10
    Views
    1,184

    have modified the program as you said which has...

    have modified the program as you said which has fixed my problem but I'm now getting segmentation faults with my makelower function

    am I calling and compairing s[n] in the right way?
  8. Replies
    10
    Views
    1,184

    i'll give that article a read, cheers and no I...

    i'll give that article a read, cheers

    and no I didnt know that I don't free the string - maybe i should do that?
  9. Replies
    10
    Views
    1,184

    Help with search program.

    I'm building a program that searches a tree for a name and then outputs their phone number. The program all works well I need to make it ignore the case of the search input when searching for a...
  10. Thread: help with trees

    by dacbo
    Replies
    2
    Views
    877

    yeah i've tried e as both a pointer and not a...

    yeah i've tried e as both a pointer and not a pointer, it still has the same pointer

    edit: maybe not, this seems to have fixed it

    cheers
  11. Thread: help with trees

    by dacbo
    Replies
    2
    Views
    877

    help with trees

    need some help with trees, basically I'm building a tree of people with names and phone numbers which will then be searched, however i keep having problems with the insert function which causes...
  12. Thread: Reading Strings

    by dacbo
    Replies
    13
    Views
    1,353

    ah cheers thats great and just to check, fgets...

    ah cheers thats great

    and just to check, fgets is a standard C function yeah? no C++ in there?
  13. Thread: Reading Strings

    by dacbo
    Replies
    13
    Views
    1,353

    hmm yeah but I cant seem to find any better way...

    hmm yeah but I cant seem to find any better way of doing it unless someone has a better idea?
  14. Thread: Reading Strings

    by dacbo
    Replies
    13
    Views
    1,353

    ok it works now by using the gets() feature ...

    ok it works now by using the gets() feature

    i've set the size of the name array to be 100 chars so there should be no problems with overflow

    thoughts?
  15. Thread: Reading Strings

    by dacbo
    Replies
    13
    Views
    1,353

    yup fixed that but it still waits until 30...

    yup fixed that but it still waits until 30 characters (including carriage returns) have been inputted before finishing the function
  16. Thread: Reading Strings

    by dacbo
    Replies
    13
    Views
    1,353

    ok i've written a new function using getchar()......

    ok i've written a new function using getchar()...



    char name[30];
    int n=0;
    while (n <=30 && name[n] != '\n') {
    name[n] = getchar();
    n++;
    }
  17. Thread: Reading Strings

    by dacbo
    Replies
    13
    Views
    1,353

    Reading Strings

    Ok this question probably has a simple answer but I currently can't find any answers on here or google.

    I'm relatively new to C but have experience in other programming languages.

    I'm writing a...
Results 1 to 17 of 17