Can whole numbers (int) and characters (char) be transmitted for the same pipe or do you need to create two different pipes? How would it be?
Can whole numbers (int) and characters (char) be transmitted for the same pipe or do you need to create two different pipes? How would it be?
For an integer it would be something like this:
int n = 45;
write(pipe, &n, sizeof(n));
And for a string of characters like this:
const char* cad = "una prueba";
write(pipe, cad, strlen(cad) + 1);