All pastes #983865 Raw Edit

Stuff

public c v1 · immutable
·published 2008-04-13 18:20 UTC
rendered paste body
[tapke@boobs-pc Logs]$ gcc ratio.cratio.c: In function ‘main’:ratio.c:41: warning: assignment makes integer from pointer without a castratio.c:42: warning: comparison between pointer and integerratio.c:42: warning: assignment makes integer from pointer without a castratio.c:43: warning: comparison between pointer and integerratio.c:43: warning: assignment makes integer from pointer without a castratio.c:44: warning: comparison between pointer and integerratio.c:44: warning: assignment makes integer from pointer without a castratio.c:46: warning: assignment makes integer from pointer without a castratio.c:47: warning: comparison between pointer and integerratio.c:47: warning: assignment makes integer from pointer without a castratio.c:48: warning: comparison between pointer and integerratio.c:48: warning: assignment makes integer from pointer without a castratio.c:49: warning: comparison between pointer and integerratio.c:49: warning: assignment makes integer from pointer without a castpati 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);         }