Glibc bug?

Dimitris Kamenopoulos el97146 at mail.ntua.gr
Sat Feb 23 19:58:35 EET 2002


On Saturday 23 February 2002 15:58, Dimitrios Stasinopoulos wrote:
> Hello All!
>
> Opoios brei ti ginetai edo, mpainei sto AUTHORS :o)
>
> Exoume ton constructor tis class Question:
>
> Question::Question(char * question)
> {
> int size=15;
> char * label=0;
>
> cout << "Question::Question()" << endl;
>
> label=(char *)malloc(size+1);
> 	if(label)
> 	{
> 	memset(label, 0, size+1);
> 	free(label);
> 	label=0;
> 	}
> }
An to evlepe auto pantws o Bjarne, mallon 8a frikare. Giati malloc-free, kai 
oxi new-delete? Giati char * kai oxi string (estw string *)?  Giati memset 
kai oxi for (...) label[i]=0? Mplekeis me poly xamhles domes kai ousiastika 
grafeis C, oxi C++. Ektos an kaneis kati poly xamhlou epipedou, kalytera 
einai na anhsyxei o compiler gia to pws 8a gemisei pio apotelesmatika ena 
string me mhdenika. Pantws an estelnes ligo perissotero kwdika (p.x. olon ton 
kwdika ths klashs Question gia arxh) 8a mporousame kai na voh8hsoume 
perissotero.




More information about the I18ngr mailing list