gcc v3.0.1 vs gcc v2.95.3 -- KDE 2.2.1
v13 at priest.com
v13 at priest.com
Sat Dec 1 23:29:01 EET 2001
On Saturday 01 December 2001 21:19, Giorgos Keramidas wrote:
>
> Sthn grammh 2 uparxei to opening { gia mia function pou legetai
> `main' kai einai tupou `int main(char*)' alla esu sth grammh 6
> anoigeis to body mias deuterhs `main' me tupo `int main(...)' pou exei
> diaforetiko tupo apo thn arxikh. (Oi treis teleies den einai kati
> sugkekrimeno, einai apla placeholder gia to prototype pou esu edoses
> sthn grammh 6, ki oxi o plhrhs tupos).
Desto ligo kalytera:
$ cat a.cc
int main(int n) {}
void main(char *p) {}
$ cat b.cc
int mmmm(int n) {}
void mmmm(char *p) {}
$ g++ a.cc -o a -c
a.cc:2: `main' must return `int'
a.cc: In function `int main(...)':
a.cc:2: declaration of C function `int main(...)' conflicts with
a.cc:1: previous declaration `int main(int)' here
$ g++ b.cc -o b -c
$
Gia eksigise moy thn diafora sta 2 parapano..
Gia na apofygoyme askopa mail (Symfona me tis apantiseis poy pira
sto proigoymeno):
1) Einai C++ kai oxi C
2) Einai aplo overloading
3) O skopos toy parapano DEN einai na ftiaksei ektelesimo,
alla bibliothiki, h opoia na periexei thn synartisi main
(leme tora.. gia tis anagkes toy paradeigmatos)
> > Gia prospathise na moy eksigiseis to parapano.
>
> Prospathisa :)
> Den jero poso kala to katafera omws.
One more time :P
> -giorgos
<<V13>>
More information about the Linux-greek-users
mailing list