Search:

Type: Posts; User: felixthunder

Search: Search took 0.01 seconds.

  1. It worked, thanks.

    It worked, thanks.
  2. And what if I want to search for argv[1] instead...

    And what if I want to search for argv[1] instead of s. The following also does not work.



    int
    main(int argc, char *argv[])
    {
    char **t;

    argc--;
  3. Using bsearch to search for a string in an array of strings.

    I have an array of strings called tab.
    I want to search for an array in it with the function bsearch() provided by <stdlib.h>.
    But I think I am doing something wrong, since it cannot find "delta"....
  4. I discover how to use dummy nodes whose .next...

    I discover how to use dummy nodes whose .next element points to the beginning of a list.
    This is how I defined merge:



    struct listnode *
    merge(struct listnode *a, struct listnode *b)
    {
    ...
  5. Yes, I am using old books, most from Kernighan...

    Yes, I am using old books, most from Kernighan and Rob Pike.
    I wrote this program for practicing with stacks, but I have another version that uses arrays: https://pastebin.com/raw/mmi0CCZR

    I am...
  6. Thanks, Such a dumb error. But hey, why did...

    Thanks,
    Such a dumb error.

    But hey, why did you say it's obvious I didn't write it?
  7. Why do you say that? I did wrote that code. ...

    Why do you say that?
    I did wrote that code.

    Do you know why it doesn't work for text given by argument?
  8. Program works for stdin but fails for a file.

    I am studying data structures and was asked to build a program that uses a stack to reverse lines of text. Here it is: https://pastebin.com/raw/CGq6ZaHM

    The problem is: it works for the stdin...
  9. Why did you declared curr as a pointer to...

    Why did you declared curr as a pointer to pointer? It could be just a regular pointer, couldn't it?
  10. How can I optimize this function that merges two ordered linked lists?

    I am learning data structures in C and, in one exercise, I was asked to create a function that merges two ordered linked lists into a single ordered linked list. Here it is:




    static...
Results 1 to 10 of 10