Code:
#include <stdio.h>
#include <pthread.h>
#define MAX_LINES 500
#define LINE_LENGTH 80
typedef struct args ARGS;
char readin[MAX_LINES][LINE_LENGTH];
struct args{
int NumCalls;
int NumStored;
};
*MakeCalls(void* params){
//stuff cut out
}
int main(int argc, char* argv[]){
//initialize an in-memory array to con
int NumStored=0;
int NumThreads=atoi(argv[1]);
int NumCalls=atoi(argv[2]);
int x;
FILE *lines = fopen("lines.txt","r");
pthread_t threads[NumThreads];
ARGS params= {NumCalls,NumThreads};
ARGS *argptr = ¶ms;
for(x=0;x<NumThreads;x++){
pthread_create(&threads[x],NULL,MakeCalls,(void *)argptr);
}
now this code compiles fine, I havent tested if it works the way I want. but I was essentially wondering about parameter 3 in pthread_create since it's throwing a warning
sample.c:80: warning: passing arg 3 of `pthread_create' from incompatible pointer type
can someone possible explain why it's throwing a warning for argptr, or direct me to a place where I can figure it out for myself