From owner-freebsd-questions@FreeBSD.ORG Mon Jan 5 07:39:11 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 217FD106566C for ; Mon, 5 Jan 2009 07:39:11 +0000 (UTC) (envelope-from zhangsc@neusoft.com) Received: from mailgate.neusoft.com (mailgate.neusoft.com [210.83.25.69]) by mx1.freebsd.org (Postfix) with ESMTP id 8CDD18FC1B for ; Mon, 5 Jan 2009 07:39:10 +0000 (UTC) (envelope-from zhangsc@neusoft.com) X-IronPort-AV: E=McAfee;i="5300,2777,5485"; a="6947588" Received: from unknown (HELO smtp.neusoft.com) ([202.107.117.28]) by mailgate.neusoft.com with ESMTP; 05 Jan 2009 15:28:56 +0800 Received: from user863c0bf569 ([192.168.131.63]) by smtp.neusoft.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPPSA id <0KCZ000XHM4AAZ@smtp.neusoft.com> for freebsd-questions@freebsd.org; Mon, 05 Jan 2009 15:28:58 +0800 (CST) Date: Mon, 05 Jan 2009 15:29:23 +0800 From: Edward King To: freebsd-questions@freebsd.org Message-id: <022201c96f07$553b65a0$3f83a8c0@user863c0bf569> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-Priority: 3 X-MSMail-priority: Normal Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 Subject: why printf() don't work? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2009 07:39:11 -0000 SSB1c2UgRnJlZUJTRDcuMCxhbmQgdXNlIHNpZ25hbCxsaWtlIGZvbGxvd3M6CnNpZ25hbChTSUdI VVAsc2lnX2h1cCk7CnNpZ25hb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