Search:

Type: Posts; User: SashaN

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    12,976

    It can also be done in this manner. #include...

    It can also be done in this manner.

    #include <stdio.h>

    void read_matrix(double *matrix, int rows, int cols);
    void print_matrix(double *matrix, int rows, int cols);

    int main(void)
    {
    ...
  2. Thread: reset strtok()

    by SashaN
    Replies
    16
    Views
    10,241

    I have not known that, but now. Thank you....

    I have not known that, but now. Thank you.
    AndiPersti thank you for interesting links.
  3. Thread: reset strtok()

    by SashaN
    Replies
    16
    Views
    10,241

    Do you have same example? For I don't understand...

    Do you have same example? For I don't understand how it works.
    That the point I do not understand. It receives a source string and returns tokens terminated by '\0'.
    But it doesn't alter the...
  4. Thread: reset strtok()

    by SashaN
    Replies
    16
    Views
    10,241

    Thank you for your help. strtok() works now as I...

    Thank you for your help.
    strtok() works now as I will, although the program is not ready yet.
    Here the code.

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>

    void get_string(char...
  5. Thread: reset strtok()

    by SashaN
    Replies
    16
    Views
    10,241

    What is wrong in my code? #include ...

    What is wrong in my code?

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>

    int main(void)
    {
    char *pos1, *pos2;
    char string[256];
  6. Thread: reset strtok()

    by SashaN
    Replies
    16
    Views
    10,241

    I have to find out, whether some word is...

    I have to find out, whether some word is contained more than one time in the string.
  7. Thread: reset strtok()

    by SashaN
    Replies
    16
    Views
    10,241

    reset strtok()

    Hallo!
    How can I reset strtoc()?
    After I have caled it twice "strtok(string, " ") ",
    it works not fine "strtok(NULL, " ")".
    Is there a solution?

    #include <stdio.h>
    #include <string.h>...
  8. Replies
    4
    Views
    1,740

    Thank you for quick answers. To breimer273: I...

    Thank you for quick answers.
    To breimer273: I have to see how valgrind works.
    To std10093: I had doubts, whether free() correct works if I allocate the memory in a separate block (in a function).
  9. Replies
    4
    Views
    1,740

    malloc() in function, free() without

    Hallo I have a question.
    Is that valid, or have I then a memory lack?


    char *getArray(int n)
    {
    char *ptr = malloc(n);
    return ptr;
    }
Results 1 to 9 of 9