메뉴 바로가기

서브메뉴 바로가기

본문 바로가기

logo

묻고 답하기
조회 수 270 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

위로 아래로 댓글로 가기 인쇄 쓰기 목록
?

단축키

Prev이전 문서

Next다음 문서

위로 아래로 댓글로 가기 인쇄 쓰기 목록
?
  • WhiteAT 2020.03.21 20:31
    안녕하세요~

    C# 은 ICompare 기능을 이용하면 간단합니다.~
    (c# 에서 sort 방법은 여러가지이며, 지금 상황에서 이 방법이 제일 간단해 보입니다.)


    1.먼저 ICompare 인터페이스로 하는 클래스를 생성합니다.
    public class TotalComparer : IComparer
    {
    public int Compare(Object x, Object y)
    {
    return (x as Student).m_nScore - (y as Student).m_nScore;
    }
    }


    2. array 에서 ICompare 를 호출해 줍니다.
    Array.Sort(arrRecord, new TotalComparer());

    이상입니다.^^

  1. 안녕하세요 C# 관련 질문있습니다!

    Date2020.09.15 Category :프로그래밍 Reply1
    Read More
  2. 아두이노 구매 관련 문의

    Date2020.09.14 Category :아두이노 Reply1
    Read More
  3. 견적 문의합니다

    Date2020.06.04 Category :아두이노 Reply1
    Read More
  4. 아두이노 코딩 의뢰합니다

    Date2020.06.03 Category :일반 Reply1
    Read More
  5. CDS 조도센서

    Date2020.04.13 Category :아두이노 Reply1
    Read More
  6. 안녕하세요 c#질문드립니다.

    Date2020.03.21 Category :프로그래밍 Reply1
    Read More
  7. 사운드 센서 문의입니다.

    Date2020.03.18 Category :아두이노 Reply2
    Read More
  8. 아두이노 코딩 문의드립니다

    Date2019.11.11 Category :아두이노 Reply1
    Read More
  9. 캡스톤디자인 아두이노 코딩 의뢰문의합니다

    Date2019.10.08 Category :프로그래밍 Reply3
    Read More
  10. 아두이노코딩의뢰드립니다

    Date2019.09.11 Category :일반 Reply2
    Read More
  11. mpu6050을 이용한twi 통신 & uart 통신 코딩 문제

    Date2019.08.18 Category :프로그래밍 Reply1
    Read More
  12. 포토 센스 신호값 PC 전달 할수 있는 모듈 확인 요청건

    Date2018.03.27 Category :일반 Reply1
    Read More
  13. C# 아두이노 연동 질문드립니다.

    Date2017.09.21 Category :프로그래밍 Reply3
    Read More
  14. 아두이노 문의드립니다.

    Date2017.08.09 Category :아두이노 Reply1
    Read More
  15. 아두이노에대해 질문있습니다

    Date2017.05.15 Category :아두이노 Reply1
    Read More
목록
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 Next
/ 11