5

C programming beginner | self-study CS course

view full story
linux-howto

https://bbs.archlinux.org – sujoy wrote:instead of "#define CORRECT_ARG_COUNT              2" , I'd rather use, "const int " here to ensure the type checking.similarly for the rest.Fine for CORRECT_ARG_COUNT, but BUFFER_SIZE, SALT_LEN, MAX_PASSWD_LEN, and NBR_OF_PRINTBL_ASCII_CHARS must be constant expressions because they're used between the [] of array definitions. A const int isn't a constant expression in C89. C99 will make them VLAs instead I think, so if that's acceptable it might not make any difference. (I hate VLAs and try never to use th (HowTos)