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...
Type: Posts; User: Soel
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...
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...
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,...
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...
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?
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?
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;
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...
Thanks, that's exactly what I needed to know!
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...
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...
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...