that did the work, thanks
Type: Posts; User: v3dant
that did the work, thanks
#include <iostream>
#include <sys/types.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
sorry i accidentally posted in the C++ section should have been in the C
/* Includes */
#include <unistd.h> /* Symbolic Constants */
#include <sys/types.h> /* Primitive System Data Types */
#include <errno.h> /* Errors */
#include <stdio.h> /*...
i got it nevermind
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <math.h>
#include <string.h>
struct block {
int size;
struct block *next;
char data[1];
};
struct heap {
int max;
struct block *free[1];
};
that did the trick thanks dave
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <math.h>
the first return statement is for testing purposes i just want to get the drand48 function to work. also i am using my own priority queue "PQ.h". I want to be able to use drand48 with visual studio...
#include <iostream>
#include <ctime>
#include <stdio.h>
#include <stdlib.h>
#include "PQ.h"
using namespace std;
int main()
{
#include <pthread.h>
#incldue <stdlib.h>
#include <cstdio.h>
#include <calloc.h>
void *testing(void *threadid)
{
printf("hello");
pthread_exit(NULL);
but now when i put a two element list into the buffer i can output the first element, but the second element outputed is 0.
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>...
that it did, thanks alot
#include <stdlib.h>
#include <pthread.h>
#define SUMSIZE 100
#define BUFSIZE 10
int *buffer [BUFSIZE];
int bufin = 0;
int bufout = 0;
pthread_mutex_t buffer_lock = PTHREAD_MUTEX_INITIALIZER;
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#define SUMSIZE 5
#define BUFSIZE 8
int *buffer[BUFSIZE];
int bufin = 0;
int bufout = 0;
pthread_mutex_t buffer_lock =...
i tried doing that, now it gives me a /var/tmp//ccjC6FRg.o(.text+0x62): In function `main':
: undefined reference to `pthread_join'
I have #include<pthread.h>
when i execute that code i get a: Segmentation fault (core dumped)
#include <pthread.h>
#include <iostream>
using namespace std;
void myfunc()
{
cout<<"hello"<<endl;
}
int main()
according to the specs i have to use one of the exec functions to create a new child process image.....
#include <iostream>
#include <cstring>
#include <ctime>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <stdio.h>
#include <poll.h>
#include "string2int.h"
using...
#include <iostream>
#include <cstring>
#include <ctime>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <stdio.h>
#include "string2int.h"
using namespace std;
#include <iostream>
#include <cstring>
#include <ctime>
#include "string2int.h"
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
#include <iostream>
#include <cstring>
#include <ctime>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
#define BSIZE 512
thansk that worked