<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>
<BR>
<BLOCKQUOTE>
....<BR>> Date: Mon, 21 May 2007 19:08:57 -0300<BR>> From: s_golbert@yahoo.com.ar<BR>... Y si uso gets para una cadena no me deja ingresarla y<BR>> > > toma caracteres tipeados antes de la llamada a gets. Espero que se<BR>> > > entienda, sino lo intento explicar un poco mejor.<BR>> > > No se cómo solucionar este problema, así que agradeceré su ayuda.<BR><BR>
AAHHH , perdona... no terminé de leer<BR>
 <BR>
ciertamente suele ocurrir debido al buffer de teclado... hay varias soluciones para C...<BR>
 <BR>
en la segunda vez que llames a la función <STRONG>scanf </STRONG>, debes llamarla de esta forma <STRONG>scanf("%</STRONG>*<STRONG>c %c ",cadena);</STRONG> aunque no me acuerdo bien, ya que no suelo usar <STRONG>scanf </STRONG>, otra forma es purgando con la funcion <STRONG>__fpurge(stdin);</STRONG> esta despues de leer una entrada por teclado. Pero en Windows mejor sustituye esta ultima funcion por <SPAN style="FONT-WEIGHT: bold"><FONT face="Courier New">fflush(stdin);</FONT></SPAN><BR><SPAN style="FONT-WEIGHT: bold"><FONT face="Courier New"></FONT></SPAN></BLOCKQUOTE>
<BLOCKQUOTE>
<SPAN style="FONT-WEIGHT: bold">Ejemplo:<BR><SPAN style="FONT-FAMILY: courier new,courier,monospace">...........<BR>printf("Introduce un caracter");<BR>scanf("%c",&c1);<BR>prinf("Introduce un segundo caracter");<BR><SPAN style="FONT-WEIGHT: bold">fflush(stdin);</SPAN> //limpiamos el buffer de teclado<BR>scanf("%c",&c1);<BR>............</SPAN></SPAN><BR>
<SPAN style="FONT-WEIGHT: bold"><SPAN style="FONT-FAMILY: courier new,courier,monospace"></SPAN></SPAN> <BR>
<SPAN style="FONT-WEIGHT: bold"><SPAN style="FONT-FAMILY: courier new,courier,monospace">Lo siento por las prisas... pero ando en clase y el profe me catea...</SPAN></SPAN><BR>
<SPAN style="FONT-WEIGHT: bold"><SPAN style="FONT-FAMILY: courier new,courier,monospace"></SPAN></SPAN> <BR>
<SPAN style="FONT-WEIGHT: bold"><SPAN style="FONT-FAMILY: courier new,courier,monospace">p.d. Cuidado porq a lo mejor no se te esta mostrando la cadena hasta el caracter especial /0 , que significa que ha llegado al final de la cadena. Y puede que te este mostrando todo el vector...</SPAN></SPAN><BR>
<SPAN style="FONT-WEIGHT: bold"><SPAN style="FONT-FAMILY: courier new,courier,monospace"></SPAN></SPAN> <BR>
<SPAN style="FONT-WEIGHT: bold"><SPAN style="FONT-FAMILY: courier new,courier,monospace"></SPAN></SPAN> <BR>
<SPAN style="FONT-WEIGHT: bold"><SPAN style="FONT-FAMILY: courier new,courier,monospace"></SPAN></SPAN> <BR>
<BR><BR>

<HR>

<P><BR>
Get news, entertainment and everything you care about at Live.com. <A href="http://www.live.com/getstarted.aspx" target=_blank>Check it out!</A> <BR></BLOCKQUOTE><br /><hr />Get news, entertainment and everything you care about at Live.com. <a href='http://www.live.com/getstarted.aspx ' target='_new'>Check it out!</a></body>
</html>