Source Code

Update: Dec 1st, 2022

Source Code from the Examples in the Book

Download here: sources.zip [169 Kb]

Browse the Source Code of “Programming = ++Algorithms;”

Warning: This is a preliminary version of the source codes.

Our intention is to prepare the source codes in such a way, that one can run them successfully with minimal efforts. However, there are cases in the book where only fragments are published, and in such cases there might be difference between what you see in the book and the corresponding C source code in the attached archive. Due to the fact we had a very limited time to prepare the sources (while many people wrote us and asked for them) we finally decided to include an initial preliminary distribution. Hence we beg for your mercy if something occasionally is not compiling, not running, or is slightly different from what is published in the book. If you find any bugs (especially if you believe the bug is also in the printing) we will be happy to hear from you. You might report them in the forum.

  1. Petar Petrov
    Jul 15th, 2013 at 10:32
    Reply | Quote | #1

    C

  2. Petar Nakov
    Jan 30th, 2016 at 14:39
    Reply | Quote | #2

    Във функцията double calculateReal(char *numb, unsigned char base) на страница 65 променливата minus не се използва когато се връща (с първия return) цяло число без дробна част и без десетична точка.

    Всичко добро !

  3. Petar Nakov
    Jan 30th, 2016 at 14:43
    Reply | Quote | #3

    Този код
    #include
    unsigned n = 4242;
    int main() {
    unsigned digits;
    for (digits = 0; n > 0; n /= 10, digits++);
    printf(“Броят на цифрите на %u е %u\n”, n, digits);
    return 0;
    }

    ще изведе n = 0 ако не се съхрани във временна променлива преди да се дели на 10:
    Броят на цифрите на 0 е 4

    ПОздрави.

  4. Petar Nakov
    Feb 14th, 2016 at 13:28
    Reply | Quote | #4

    Hi, on page 79 function unsigned long fact(void) in file factrec.c retrun wrong result 6! = 1 , but with this code change maube will be:

    const unsigned n = 6;

    unsigned i;
    unsigned long fact(void)
    {
    if (i == 1)
    return 1;

    unsigned tmp = i;

    return –tmp * fact();
    }

    ПОздрави.

  5. Petar Nakov
    Feb 22nd, 2016 at 09:11
    Reply | Quote | #5

    Hi, poslednia moji komentar ne e bil tochen kato factoriel moje da se nameri i bez nova promenliva, a s vzemane pod vnimanie na prioriteta na operaciite v return-a na funkciata:

    unsigned long fact(void)
    { if (i == 1) return 1;
    return –i * fact();
    }

    ПОздрави.

  6. alex
    Jun 13th, 2016 at 18:22
    Reply | Quote | #6

    Здравейте,

    Има проблем с енкодинга на българския език в коментарите и функциите за принтиране. Възможно ли е да го коригирате или да ми кажете как бих могъл аз да го направя ? Ако не – бих започнал кампания в Гитхъб да се поправи, но това би било доста разходно от към време.