delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/05/22:53:24

Message-ID: <20010906025020.8914.qmail@sina.com>
From: xuchuan <xuchuan AT sina DOT com>
To: djgpp AT delorie DOT com
Subject:
Date: Thu, 06 Sep 2001 10:50:20 +0800
X-Mailer: SinaMail 3.0Beta (FireToad)
X-Priority: 3
Reply-To: djgpp AT delorie DOT com

Hi, I am using djgpp now. But I've met a problem. See the program below.

#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

int main()
{	
	string s;		
	s = "0";
	cout << setw(5) << s << endl;
	cout << setw(5) << "0" << endl;
	return 0;
}

the output on my pc:
0
    0


In my opinion, the two lines of output should be the same, which is not in fact. Is it a bug of djgpp, or I've made some mistakes?

I compiled the program under win2000, using djgpp v2.03 and gpp 2.9.52.

BTW: Does djgpp support the sstream library? It is quite convenient.

===================================================================
ÐÂÀËÃâ·Ñµç×ÓÓÊÏä (http://mail.sina.com.cn)
ÏëÈÃ100ÍòÄ°ÉúÈËͬʱ°®ÉÏÄãô?À´ÕÒÎÒ°É! (http://cheese.sina.com.cn)
ÕÒÅóÓÑ£¿ÕÒ¹¤×÷£¿ÕÒÉú»îʵÓÃÐÅÏ¢£¿µ½ÐÂÀË·ÖÀàÐÅÏ¢ (http://classad.sina.com.cn/)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019