2012-11-15 9 views
0

안녕하세요 다음 중첩 된 구조체를 만들고 그것을 사용하려고 해요하지만 난 그것을 내가 무슨 짓을했는지중첩 호출하는 방법을 구조체

을 할 수없는 사람은

public struct number 
     { 
      int[] linenumber; 


      public struct information 
      { 
       public linenumber name, surname, id, phone; 

      } 
     } 

내가 스택 번호의 배열을 만들고 스택의 각 번호에 성 이름과 전화 정보를 저장해야합니다.

이 번호를 쓰려면 다음과 같이하십시오. number inf = new number(); 그런 다음 inf.linenumber [n] .name을 시도하십시오. // 여기서 n은 카운터입니다.하지만 작동하지 않는 아이디어가 있습니까?

미리 감사드립니다.

답변

0

다음과 같이 작성해야합니다.

public struct number 
    { 
     public information[] linenumber; 


     public struct information 
     { 
      public string name, surname, id, phone; 

     } 
    } 
관련 문제