🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #9309

fgets

#9309
From: quantium
Date: Sun, 11 Aug 2002 19:17
15 lines
1408 bytes
� sabeis por que el siguiente codigo imprime en dos lineas diferentes 
printf("%s tiene %i caracteres\n",array,strlen(array)); ? tengo 
entendido que fgets pone un \n al final de su cadena � sabeis como 
podria quitar ese \n?

char array[10];

printf("Inserte la frase: ");
fgets(array,10, stdin);
printf("%s tiene %i caracteres\n",array,strlen(array));

Uso fgets porque segun he podido leer en el man de gets(), este es 
peligroso de usar y que use fgets.

Un saludo a todos.
Technical Details
Message-ID: <3D56B84F.7010102@lycos.es>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.nacamar.de!fu-berlin.de!uni-berlin.de!62.174.160.196!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,d8ad4c1d57de0ffc,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-08-11 12:17:33 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.nacamar.de!fu-berlin.de!uni-berlin.de!62.174.160.196!not-for-mail
From: quantium <quantium@lycos.es>
Newsgroups: es.comp.os.linux.programacion
Subject: fgets
Date: Sun, 11 Aug 2002 21:17:35 +0200
Lines: 16
Message-ID: <3D56B84F.7010102@lycos.es>
NNTP-Posting-Host: 62.174.160.196
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 1029093452 43496811 62.174.160.196 (16 [129971])
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc3) Gecko/20020523
X-Accept-Language: en-us, en