preklad odborneho textu (anglictina)
narazil som na jednu vetu, ktoru proste nedokazem spravne prelozit/pochopit. stale neviem co tym chcel basnik povedat.
However, many still prefer to cast malloc because they feel it makes the intentions of the memory allocation more clear. There is nothing wrong with this except in the event that stdlib.h, the header which declares malloc, is not included. If the return of malloc is cast then the error which would be flagged is hidden, resulting in a difficult to find bug. Also, during maintenance, if the type of the pointer changes but the cast is not changed, once again there is a difficult to find bug. The method most experienced programmers choose is:
http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1047673478&id=1043284351
nenajde sa tu niekto, kto by mi to vedel (zvyraznenu vetu) spravne prelozit/vysvetlit? :)
vopred dakujem
Pre pridávanie komentárov sa musíte prihlásiť.
Ak je urcena navratova hodnota "malloc", potom error ktory by mal byt znazorneny je skryty, co v konecnom dosledku znamena ze je takze najst chybu.
Je mozne nieco taketo ?
v podstate ano, len to "cast" bude urcite pretypovanie (type casting). ako uz som hore napisal, tak vlastne by ma viac ako ten presny preklad zaujimalo co tym autor myslel, cize otazka na nejakeho C kodera:) nechapem ako/preco by mala byt skryta nejaka chyba vdaka pretypovaniu.
nestazte sa to vysvetlovat, mne len nedalo nezareagovat
pre niekoho kto ma s programovanim (alebo coho sa to vlastne tyka) nejake skusenosti je to asi jednoznacne ale mne to nic nehovori a popravde a netuzim tomu rozumiet :-DD