레코드 (컴퓨터 과학)

위키백과, 우리 모두의 백과사전.

컴퓨터 과학에서 레코드(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}
    

같이 보기[편집]

각주[편집]

  1. “Computer Science Dictionary Definitions”. 《Computing Studenta》. 2021년 1월 24일에 원본 문서에서 보존된 문서. 2018년 1월 22일에 확인함. 
  2. Radványi, Tibor (2014). 《Database Management Systems》. Eszterházy Károly College. 19쪽. 2018년 9월 23일에 확인함. 
  3. Kahate, Atul (2006). 《Introduction to Database Management Systems》. Pearson. 3쪽. ISBN 978-81-317-0078-5. 2018년 9월 23일에 확인함. 
  4. Connolly, Thomas (2004). 《Database Solutions: A Step by Step Guide to Building Databases》 2판. Pearson. 7쪽. ISBN 978-0-321-17350-8. 2018년 9월 23일에 확인함. 
  5. Felleisen, Matthias (2001). 《How To Design Programs》. MIT Press. 53,60쪽. ISBN 978-0262062183. 2018년 9월 23일에 확인함.