<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<P>Hola, tengo una duda que querría que me solucionarais.</P>
<P> </P>
<P>Si en una estructura como esta:</P>
<P> </P>
<P><FONT face="tahoma, new york, times, serif" color=#0000ff>struct Bits</FONT></P>
<P><FONT face="tahoma, new york, times, serif" color=#0000ff>{<BR>       unsigned short bit1:5;//Variable unsigned short de 5 bits<BR>       unsigned short bit2:4;//Variable unsigned short de 4 bits<BR>       unsigned short bit3:7;//Variable unsigned short de 7 bits<BR>}Param[10];</FONT></P>
<P><FONT face=Tahoma color=#0000ff></FONT> </P></DIV></DIV>
<DIV>Luego uso este bucle:</DIV>
<P> </P>
<P><FONT color=#0000ff> </FONT><FONT face="tahoma, new york, times, serif" color=#0000ff>for(k = 0; k < 10; k++)<BR>    {<BR>          cin >> Param[k].bit1;<BR>          cin >> Param[k].bit2;<BR>          cin >> Param[k].bit3;<BR>     }</FONT></P>
<P><FONT face=Tahoma color=#0000ff></FONT> </P>
<P><FONT face="times new roman, new york, times, serif">A continuación el compilador me da un error para cada una de las lineas donde escribo los "cin >> ". Pone algo así:</FONT></P>
<P><FONT color=#ff0000>"In function 'int main()':</FONT></P>
<P><FONT color=#ff0000>cannot bind bitfield 'Param[k].Bits::bit1' to 'short unsigned int&'</FONT></P>
<P><FONT color=#ff0000>cannot bind bitfield 'Param[k].Bits::bit2' to 'short unsigned int&'</FONT></P>
<P><FONT color=#ff0000>cannot bind bitfield 'Param[k].Bits::bit3' to 'short unsigned int&'</FONT></P>
<P>¿Qué está pasando y cómo lo puedo solucionar?</P>
<P> </P>
<P>Porque supongo que en el 2º problema de estructuras es esto a lo que os referís.</P>
<P> </P>
<P>Un saludo y gracias por vuestra ayuda, Alejandro.</P></DIV></DIV></div><br>
                <hr size=1><br><font face="Verdana" size="-2">LLama Gratis a cualquier PC del Mundo.<br>Llamadas a fijos y móviles desde 1 céntimo por minuto.<br><a href="http://us.rd.yahoo.com/mail/es/tagline/messenger/*http://es.voice.yahoo.com/">http://es.voice.yahoo.com</a></font></body></html>