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

레코드 (컴퓨터 과학)

위키백과, 무료 백과사전

Remove ads

컴퓨터 과학에서 레코드(record) (Struct 나 사용자 정의 타입(User Defined Types) 이라고도 한다.)는 각기 다른 자료형에 속할 수 있는 필드의 모임이며, 문자열, 정수, 시퀀스 등 사용자 정의에 따라 여러가지가 들어가 있다.[1]

데이터베이스스프레드시트의 레코드는 보통 로우(row)라고 부른다.[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