Question: I'm getting this warning when I try to compile the code below. 11:5 warning: assignment makes pointer from integer without a cast [enabled by default]
I'm getting this warning when I try to compile the code below. 11:5 warning: assignment makes pointer from integer without a cast [enabled by default] ptr = strtok(str, " "); The language is in C and I'm using the newest version of Ubuntu.
#include
char c[1000]; FILE *fptr; fptr=fopen("output.txt","w"); fprintf(fptr,"%s"," Process\t|Turnaround Time|Waiting Time ");
for(time=0,count=0;remain!=0;) { if(rt[count]<=time_quantum && rt[count]>0) { time+=rt[count]; rt[count]=0; flag=1; } else if(rt[count]>0) { rt[count]-=time_quantum; time+=time_quantum; } if(rt[count]==0 && flag==1) { remain--; fprintf(fptr,"P[%d]\t|\t%d\t|\t%d ",count+1,time-at[count],time-at[count]-bt[count]);
printf(); wait_time+=time-at[count]-bt[count]; turnaround_time+=time-at[count]; flag=0; } if(count==n-1) count=0; else if(at[count+1]<=time) count++; else count=0; } fprintf(fptr," Average Waiting Time= %f ",wait_time*1.0/n); fprintf(fptr,"Avg Turnaround Time = %f",turnaround_time*1.0/n); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
