Hi, I've created the below code:
int main(int argc, char *argv[])
{
int n;
pid_t pid;
int status;
pid = fork();
Type: Posts; User: Sergi
Hi, I've created the below code:
int main(int argc, char *argv[])
{
int n;
pid_t pid;
int status;
pid = fork();
Thanks for the reply Salem, that was helpful.
Hi, I'm trying to understand why I can't overwrite with strcpy on this piece of code:
int main (int argc, char *argv[])
{
char *str2;
char *str = malloc(sizeof(char)*10000);
str2 = "...
Thanks Salem
Those pieces of code are part of an assignment. I need to work on them later on to optimize them in different ways, however at this point I'd like to understand why the second one takes much longer...
Hi, I have two programs that perform the same task:
#define N 100000000
int main()
{
long int x;
double sum=0;
char str[100];
Will look into that, thanks for your help.
My question is, what status is returned when the UX command the child is executing doesn't exist or can't be executed because it's a wrong path?
I'm asking because I'm using WIFEXITED(status) and...
Hi, I have this program which gets two arguments as parameters and runs it in linux:
int main(int argc, char *argv[])
{
int status;
thanks Salem, it works fine now. I've found that nomenclature in many tutorials. Again, thanks for correcting that one.
Thanks Salem. The issue is, I'm already assigning the space with this line in my original code:
fact_table[i].str_fact = (char *)malloc(log10(fact_table[i].lli_fact));
I've tried...
Hi, I have the below code:
struct fact_entry
{
int n;
long long int lli_fact;
char *str_fact;
};
Hi everyone, I have this assignment in which I need to run "ls" every N seconds. We're not allowed to use signals, we can only use the command sleep, but via an exec function, we can't use "system"....