C problem...se megethos domhs
John Tsiombikas (Nuclear / the Lab)
nuclear at siggraph.org
Sun Jan 25 00:52:03 EET 2004
V13 wrote:
> On Saturday 24 January 2004 22:24, John Tsiombikas (Nuclear / the Lab) wrote:
>>To oti o compiler den exei tin dynatotita na elenksei an ta arguments pou
>>pername einai ontos ayta pou perimenei i synartisi mporei na odigisei se
>>diafora bugs me stack corruption klp klp, giayto genikos theorite kalo na
>>dilononte ta arguments tis synartisis.
>
>
> Kapoy ta exeis mperdepsei... To:
Nomizo oti esy kapou ta exeis mperdepsei...
>
> void koko(a,b)
> int a;
> char b;
> {
> ....
> }
old-style (apo pro ANSI C epoxi) stin ANSI C (apo to 1989 diladi kai meta) ta
argument types pane mesa stin parenthesi.
void koko(int a, char b)
{
....
}
>
> Den exei kamia sxesi me to parakato:
>
> void koko()
> {
> ....
> }
>
> Otan bazeis () einai *AKRIBOS* to idio me to (void)
exm OXI :)
ayto pou les einai entelos lathos, elenkse ligo tis piges sou.
kai epidi thelo na se boithiso na katalabeis apo pou proerxete i sygxisi pou
exeis sou paratheto kai ti sosti apantisi:
stin C :
---------------
void koko(void);
simenei oti i synartisi den pairnei kanena argument.
void koko();
simenei oti i synartisi mporei na parei otidipote plithos i arithmo arguments,
aplos o compiler den elenxei ti pernas stin synartisi (apenergopoiei to checking
ousiastika).
stin C++ :
----------------
void koko(void);
simenei oti i synartisi den pairnei kanena argument.
void koko();
simenei oti i synartisi den pairnei kanena argument.
elpizo na boithisa stin katanoisi diaforon metaksi C kai C++ :)
-- Nuclear / the Lab --
More information about the Linux-greek-users
mailing list