rendered paste body[tapke@boobs-pc Logs]$ gcc ratio.c
ratio.c: In function ‘main’:
ratio.c:41: warning: assignment makes integer from pointer without a cast
ratio.c:42: warning: comparison between pointer and integer
ratio.c:42: warning: assignment makes integer from pointer without a cast
ratio.c:43: warning: comparison between pointer and integer
ratio.c:43: warning: assignment makes integer from pointer without a cast
ratio.c:44: warning: comparison between pointer and integer
ratio.c:44: warning: assignment makes integer from pointer without a cast
ratio.c:46: warning: assignment makes integer from pointer without a cast
ratio.c:47: warning: comparison between pointer and integer
ratio.c:47: warning: assignment makes integer from pointer without a cast
ratio.c:48: warning: comparison between pointer and integer
ratio.c:48: warning: assignment makes integer from pointer without a cast
ratio.c:49: warning: comparison between pointer and integer
ratio.c:49: warning: assignment makes integer from pointer without a cast
pati programa :
#include "stdio.h"
#include "math.h"
FILE *down;
FILE *up;
main()
{
int uplo = 0, downlo = 0;
int temp;
down = fopen("Downloads.log", "rt");
up = fopen("Uploads.log", "rt");
while(!feof(down))
{
fscanf(down,"%d", &temp);
if (temp > 0 )
{
downlo = downlo + temp;
printf("%d\n",downlo);
temp = 0;
}
}
while(!feof(up))
{
fscanf(up,"%d", &temp);
if (temp > 0 )
{
uplo = uplo + temp;
printf("%d\n",uplo);
temp = 0;
}
}
float ratio = uplo/downlo;
char sizeU, sizeD;
printf("lyg ir gaunasi D:%d U:%d Ratio:%f\n", downlo, uplo, ratio);
if (downlo >= 1024) { downlo = downlo / 1024; sizeD = "K";}
if ((downlo >= 1024)&&(sizeD == "K")) { downlo = downlo/1024; sizeD = "M";}
if ((downlo >= 1024)&&(sizeD == "M")) { downlo = downlo/1024; sizeD = "G";}
if ((downlo >= 1024)&&(sizeD == "G")) { downlo = downlo/1024; sizeD = "T";}
if (uplo >= 1024) { uplo = uplo / 1024; sizeU = "KB";}
if ((uplo >= 1024)&&(sizeU == "K")) { uplo = uplo/1024; sizeU = "M";}
if ((uplo >= 1024)&&(sizeU == "M")) { uplo = uplo/1024; sizeU = "G";}
if ((uplo >= 1024)&&(sizeU == "G")) { uplo = uplo/1024; sizeU = "T";}
printf("+me Ratio: %3.2f ( Upload: ~%d %c | Download: ~%d %c )\n",ratio,uplo,sizeU,downlo,sizeD);
}