MESSAGE
DATE | 2002-09-20 |
FROM | Ruben I Safir
|
SUBJECT | Subject: [hangout] C program
|
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....
|
|