1. Си / Говнокод #6636

    +146

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    char* a(int pos, char* path)
    { 
        FILE *dbf;
          char value; 
          int i,j,k,l,m,n,o,p,r;
          int numrecs, recnum; 
          Record rec;
          char aa[158];
          char *pp;
          int ln, lp, lc, le, lw, li, ls, lph, lf;    
    
          numrecs = rec.length; 
          recnum = pos;
        dbf = OpenDB(path, &rec);
        ReadRecord(dbf, recnum, &rec);    
        
            ln = strlen(rec.name);
            ls = strlen(rec.surname);
            lp = strlen(rec.patronymic);
            lph = strlen(rec.phone);
            lc = strlen(rec.city);
            le = strlen(rec.edu);
            lw = strlen(rec.work);
            li = strlen(rec.interests);
            lf = strlen(rec.friends);
    
            itoa(recnum, &(aa[0]), 10);
            for (i = 1; i < ln; i++)
                aa[i] = rec.name[i-1];
            for (j = 0; j < ls; j++)
                aa[i+j] = rec.surname[j];
            for (k = 0; k < lp; k++)
                aa[i+j+k] = rec.patronymic[k];
            for (l = 0; l < lph; l++)
                aa[i+j+k+l] = rec.phone[l];
            for (m = 0; m < lc; m++)
                aa[i+j+k+l+m] = rec.city[m];
            for (n = 0; n < le; n++)
                aa[i+j+k+l+m+n] = rec.edu[n];
            for (o = 0; o < lw; o++)
                aa[i+j+k+l+m+n+o] = rec.work[o];
            for (p = 0; p < li; p++)
                aa[i+j+k+l+m+n+o+p] = rec.interests[p];
            for (r = 0; r < lf; r++)
                aa[i+j+k+l+m+n+o+p+r] = rec.friends[r];
    
        pp = strdup(aa);  
        return pp;
    }

    Запостил: dotnetdeveloper, 12 Мая 2011

    Комментарии (20) RSS

    Добавить комментарий