Search:

Type: Posts; User: Soel

Search: Search took 0.00 seconds.

  1. Thread: Mutex question

    by Soel
    Replies
    1
    Views
    1,907

    Mutex question

    Hello!
    I'm writing a C program with mutex where I need to use the function pthread_mutex_destroy(). Searching on google I read that when this function is called by the thread that has the lock, all...
  2. Replies
    6
    Views
    1,403

    Thanks, but I was following an exercise that...

    Thanks, but I was following an exercise that asked to read a number from the stdin, store it in a local variable in the parent process and then pass it to the child through the shared memory.
    Maybe...
  3. Replies
    6
    Views
    1,403

    Question about shared memory

    Hello! I'm trying to learn how to use shared memory, so I wrote a simple program to exchange an integer value between a parent process and its child.
    The problem is that the program doesn't work,...
  4. Replies
    3
    Views
    1,797

    Redirecting stdout

    Hello!
    I'm trying to write a program able to execute the "date" command, retrieve the date printed on the standard output and then pass it to a variable in the program. Unfortunately my program...
  5. Thread: Freeing memory

    by Soel
    Replies
    10
    Views
    1,279

    Thanks again! One last question: freeing my...

    Thanks again!
    One last question: freeing my variable 'a' in the example of the first post doesn't free also the 'b' variable pointed by its internal field, am I right?
  6. Thread: Freeing memory

    by Soel
    Replies
    10
    Views
    1,279

    Thanks for all the answers! This is to...

    Thanks for all the answers!



    This is to avoid that, if the memory is later assigned to another variabile, the variable will be pre-allocated with the old values in that memory space?
  7. Thread: Freeing memory

    by Soel
    Replies
    10
    Views
    1,279

    Freeing memory

    Hello!
    I have a doubt about how the operation of freeing memory works.
    If i write a program like this one:


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

    struct orderlistNode {
    int number;
  8. Thread: Deep copy

    by Soel
    Replies
    5
    Views
    4,035

    Thanks again! As for your question, I'm not...

    Thanks again!
    As for your question, I'm not trying to turn C in C++. I have a university work to do that involves the creation of a library that adapts the design patterns of OO languages to be used...
  9. Thread: Iterator Pattern

    by Soel
    Replies
    4
    Views
    3,215

    Thanks, that's exactly what I needed to know!

    Thanks, that's exactly what I needed to know!
  10. Thread: Deep copy

    by Soel
    Replies
    5
    Views
    4,035

    Deep copy

    Hello!
    I'd like to know if it's possible to create a function that performs a deep copy of a struct variable without being bound to its particular internal representation. In other words, a function...
  11. Thread: Iterator Pattern

    by Soel
    Replies
    4
    Views
    3,215

    You mean a pointer to a function that implements...

    You mean a pointer to a function that implements how to move from a node to the next one? I didn't think about that, that's a nice idea!
    The only problem is that, in theory, the iterator pattern...
  12. Thread: Iterator Pattern

    by Soel
    Replies
    4
    Views
    3,215

    Iterator Pattern

    Hello!
    I'm trying to write a library to implement iterators in C. The iterators should work on classical linked lists written in C, with each node being an instance of a struct containing a pointer...
Results 1 to 12 of 12