I need all combinations of subsets of a string. In addition, a subset of length 1 can only be followed by a subset with length > 1. E.g. for string 4824 the result should be:
[ [4, 824], [4, 82,...
Type: Posts; User: Freaky256
I need all combinations of subsets of a string. In addition, a subset of length 1 can only be followed by a subset with length > 1. E.g. for string 4824 the result should be:
[ [4, 824], [4, 82,...
Does that mean every time when the timeout elapses before I receive a packet I get an error? Because than it would not make any difference to increase the timeout because I'm not even sure I will...
Ok now I get the additional info:
Resource temporarily unavailable
Alright, but if I omit the loop and simply send only one packet, when calling the recv(...)
if ((bytes = recv(sock_fd, packet, sizeof(packet), 0)) <= 0) {
printf("ERROR READ\n");...
I would like to send ethernet packets in a loop and then receive the reply packet (if any). Here the short version of the code (hope its understandable enough):
for (int i=0; i<someValue; i++)...
Two processes shall communicate with each other. After two seconds the father should send a message to his son, if he's still alive and vice versa. The user can kill one of the two processes entering...
Ok changed my code no, looks like this:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Ok but after I created another fork() do I still have just 2 branches or do I have to make four now?
Like:
pid1 = fork();
pid2 = fork();
if (pid1==0) {
But were do I have to write the second pipe into the "else" branch?
We are not allowed to use popen or system...
I have to create a pipe which simulates the shell command " ps -aux | sort -n | head -10 "
For one pipe the code would be like this:
#include <stdio.h>
#include <stdlib.h>
#include...