On Wed, Mar 8, 2017 at 12:25 PM Alexandru Elisei via so < [email protected]> wrote:
> Din enunt: "Lungimea hash-ului și a unui cuvânt vor fi reprezentate pe > un număr pe *32 de biți (fără semn).*" > > Din declaratia functiei de hash [1]: > unsigned int hash(const char *str, unsigned int hash_length); > > Din ISO C99, capitolul 5.2.4.2.1 Sizes of integer types: > "Their implementation-defined values shall be equal or greater in > magnitude (absolute value) to those shown, with the same sign. > [..] > — maximum value for an object of type unsigned int > UINT_MAX 65535 // 2^16 - 1" > > Se depuncteaza daca nu folosim un fixed-width integer (ca uint32_t) > pentru dimensiunea hash-ului din moment ce functia de hash returneaza > un unsigned int? > > [1] > https://github.com/systems-cs-pub-ro/so-assignments/blob/master/1-multi/util/hash.h#L16 Salut, Alexandru! E ok să folosiți atât unsigned int cât și uint32_t. Pe sistemul de test este același lucru. Spor în continuare, Răzvan
_______________________________________________ http://ocw.cs.pub.ro/courses/so/info/lista-discutii
