The problem is that i have to do that way a thread to receive and a thread to read and answer(this is an assignement).
Type: Posts; User: maritos
The problem is that i have to do that way a thread to receive and a thread to read and answer(this is an assignement).
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <netinet/in.h>
#include <time.h>...
Hi i have a problem with my code, if anyone here can help.
ok i create a thread that executes a function that receives a browser request and put it in a buffer. I create another thread that read the...
This is just a piece of my code. The fopen() call is there. And why cannot
i make this int array[bytes] . bytes its an int.
Ok iīve done something like this.
FILE *fp;
if(fp != NULL) {
fseek(fp,0,SEEK_END);
bytes = ftell(fp);
int array[bytes];
Ok i have done something like this
int array[file_lenght];
fread(array,sizeof(int), file_length, file);
Tanks but can you be more especific.
I do this:
File *fp;
fp = fopen("...", "rb");
Hi iīm doing a program that requires sending a message with the lenght of the file and itīs content. How can i do this. I know how to send the content of the file, if the file contains characters,...
Hi, i have a little problem in my code .
void thread_exit() {
thread_t running_thread = list->element;
thread_t next_thread = list->next->element;
remove_list(&list,...
while(1) {
char cmd[20];
printf("Shell: "); scanf("%s",&cmd);
res = fork();
if(res==0) {
if((strcmp("ls",cmd))==0) { execl("/bin/ls","ls",NULL);...
so how can i make this work:
if i put
>Console$: ls
i want the program execute the ls command and if i put:
>Console$: exit
I quit the program, but it seems he canīt execute any command.
Hi, i want to make a little command line shell that executes programs with any required arguments.
But i dont understand what is the problem, why the program donīt work.
main() {
char...
I want to make a very simple linux shell in c (one that will just run one program with any required arguments ) but th program is not working, i dont know why.
void prompt() {
...
Thanks. But what if i want to put 13 and 3 5 by stdin, like this:
1 3
3 5
#include <stdio.h>
int main(int argc,...
#include <stdio.h>
#define MAX 10
int main(int argc, char**argv)
{
int v1,v2,vt1,vt2,a;
char buff[MAX];
#include <stdio.h>
#define MAX 10
int main(int argc, char**argv)
{
int v1,v2,vt1,vt2,a;
char buff[MAX];
Hi, i have to make a program that cheks on a file formatted like that:
1 2 1
1 3 3
3 5 6
If i put 1 3 by stdin the program must return 1 3 3.
Another example if i put 3 5 by stdin must return...