MESSAGE
DATE | 2002-09-20 |
FROM | Ruben I Safir
|
SUBJECT | Subject: [hangout] C program
|
From owner-hangout-desteny-at-mrbrklyn.com Fri Sep 20 05:13:38 2002 Received: from www2.mrbrklyn.com (localhost [127.0.0.1]) by mrbrklyn.com (8.12.3/8.11.2/SuSE Linux 8.11.1-0.5) with ESMTP id g8K9Dcqu006091 for ; Fri, 20 Sep 2002 05:13:38 -0400 Received: (from mdom-at-localhost) by www2.mrbrklyn.com (8.12.3/8.12.3/Submit) id g8K9Dc0N006090 for hangout-desteny; Fri, 20 Sep 2002 05:13:38 -0400 X-Authentication-Warning: www2.mrbrklyn.com: mdom set sender to owner-hangout-at-www2.mrbrklyn.com using -f Received: from www2.mrbrklyn.com (localhost [127.0.0.1]) by mrbrklyn.com (8.12.3/8.11.2/SuSE Linux 8.11.1-0.5) with ESMTP id g8K9Dbqu006085 for ; Fri, 20 Sep 2002 05:13:37 -0400 Received: (from ruben-at-localhost) by www2.mrbrklyn.com (8.12.3/8.12.3/Submit) id g8K9Dbg2006084 for hangout; Fri, 20 Sep 2002 05:13:37 -0400 Date: Fri, 20 Sep 2002 05:13:37 -0400 From: Ruben I Safir To: hangout-at-www2.mrbrklyn.com Subject: [hangout] C program Message-ID: <20020920051337.A6074-at-www2.mrbrklyn.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Mailer: Balsa 1.2.3 Sender: owner-hangout-at-mrbrklyn.com Precedence: bulk Reply-To: Ruben I Safir List: New Yorkers Linux Scene Admin: To unsubscribe send unsubscribename-at-domian.com to hangout-request-at-www2.mrbrklyn.com X-Evolution: 00000063-0000 Content-Length: 1457 Lines: 45 Status: RO X-Status: A X-Keywords: X-UID: 4281
I'm doing a journal article on C for Beginner and I stumbled on something I don't understand
The program is simple:
#include #include
char name[255];
int main(int argc, char **argv){ printf("Welcome to NYLXS\n"); printf("Enter your name-->\n"); fgets(name, 255, stdin);
while(strcmp("\n", name) != 0){ printf("%s", name); fgets(name, 255, stdin); } return(1); }
fgets seems to just take in any number of chars - blowing right past the 255 limit of the size
Ruben -- __________________________
Brooklyn Linux Solutions __________________________ DRM is THEFT - We are the STAKEHOLDERS http://www.nyfairuse.org
http://www.mrbrklyn.com - Consulting http://www.nylxs.com/radio - Free Software Radio Show and Archives http://www.brooklynonline.com - For the love of Brooklyn http://www.nylxs.com - Leadership Development in Free Software http://www.nyfairuse.org - The foundation of Democracy http://www2.mrbrklyn.com/resources - Unpublished Archive or stories and articles from around the net http://www2.mrbrklyn.com/mp3/dr.mp3 - Imagine my surprise when I saw you... http://www2.mrbrklyn.com/downtown.html - See the New Downtown Brooklyn....
1-718-382-5752
____________________________ New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless....
|
|