C++ gcc3.3.5 compilation error

Alexandros Kosiaris alex at noc.ntua.gr
Fri Sep 16 14:34:01 EEST 2005


Argiris Mokios wrote:
> Kalispera,
> 
> prospa8w na kanw compile to:
> 
> void IInteger::write(ostream *st, int base) const
> {
>  char *str = to_string(base);
>  (*st) << str;
>  delete str;
> }
> 
> kai mou vgazei:
> 
> error: no match for 'operator<<' in '*st << str'
> 
> Dokimasa kati type casting alla tipota.
> Kamia idea?
> 
> stringstream::str 
> http://www.cplusplus.com/ref/iostream/stringstream/str.html
> ostream::operator<<  
> http://www.cplusplus.com/ref/iostream/ostream/operatorltlt.html
> 

Εαν δεν κάνω λάθος το ostream ( output stream ) δεν ορίζει τον operator
<< που πας να χρησιμοποιήσεις γιατι πολύ απλά αυτός συνήθως σημαίνει
input και οχι output. Εδώ με αυτά που έχεις γράψει πας να κάνεις input
sto st από το str που δεν ορίζεται.
Δεν έχω καταλάβει τι ακριβώς θες να κάνει η συνάρτηση αλλα:
Μήπως θες iostream αντί για ostream ??


-- 
Alexandros Kosiaris 	Network Management Center , NTUA
e-mail : alex at noc.ntua.gr
Public Key Fingerprint :
D6B1 0634 BE65 719C 6C95  7492 8201 4B46 C478 F074
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3166 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.hellug.gr/pipermail/linux-greek-users/attachments/20050916/3f326d4b/attachment.bin>


More information about the Linux-greek-users mailing list