상위 질문
타임라인
채팅
관점

레코드 (컴퓨터 과학)

위키백과, 무료 백과사전

Remove ads

컴퓨터 과학에서 레코드(record, struct)는 기본적인 자료 구조이다. 데이터베이스스프레드시트의 레코드는 보통 로우(row)라고 부른다.[1][2][3][4]

레코드는 각기 다른 자료형에 속할 수 있는 필드의 모임이며, 보통 고정 숫자나 시퀀스로 이루어져 있다.[5] 레코드의 필드들은 특히 객체 지향 프로그래밍에서 멤버(member)로도 부른다.

예시

다음은 레코드 정의의 예를 보여준다.

  • PL/I:
      declare 1 date,
                2 year  fixed binary,
                2 month fixed binary,
                2 day   fixed binary;
    
  • Algol 68:
  mode date = struct (int year, int month, int day);
  • C:
    struct date {
       int year;
       int month;
       int day;
    };
    
  • Go:
    type Date struct {
            year  int
            month time.Month
            day   int
    }
    
  • 파스칼:
    type TDate = record
       Year: Integer;
       Month: 1..12;
       Day: 1..31;
    end;
    
  • 러스트:
    struct Date {
       year: u32,
       month: u32,
       day: u32,
    }
    
  • 하스켈:
    data Date = Date { year :: Integer
                     , month :: Integer
                     , day :: Integer
                     }
    
  • 줄리아:
    struct Date
        year::Int
        month::Int
        day::Int
    end
    
  • Standard ML:
    type date = {year:int, month:int, day:int}
    
Remove ads

같이 보기

각주

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.

Remove ads