본문 바로가기
지식

Parameter, Argument, Element

by 코드 이야기 2022. 5. 21.
728x90

 

아래의 C++ 코드와 함께 설명하겠습니다 :)

1 | int add(int a, int b) {
2 |   return a + b;
3 | }
4 | 
5 | int main() {
6 |   int arr[] = {3, 4, 5,};
7 |   
8 |   cout << add(4, arr[2]);
9 | }

 

 

Argument (= 인수)

함수의 결과를 얻기 위해 제공되는 

add(4, arr[2]

8번째 줄에 해당하는 호출 부분. 호출할 때 입력해주는 값(전달해주는 값)을 의미합니다. 

 

Parameter (= 매개변수)

함수와 같은 서브루틴인풋으로 제공되는 여러 데이터 중 하나

int add(int a, int b)

1번째 줄에 해당하는 선언 부분. 호출될 때(/선언될 때) 제공받은(/제공받을) 인수 값을 의미합니다.

 

Element

여러 값들 중 하나의 요소(= item, ...)

int arr[] = {345,};

6번째 줄에 해당하는 배열 부분. 배열, 리스트 등 여러 값들 중 하나의 값, 각각의 값을 의미합니다.

int만 되는 것이 아니고, 구조체, 객체, 기본자료형 등의 모든 자료형은 엘리먼트가 될 수 있습니다.

- 그렇다고 "값 = 엘리먼트"인 것은 아닙니다. 여러 값(배열, 리스트 등) 중에 하나의 값이 엘리먼트(= 요소, item)라 불리는 것입니다.

 

 

 

 

 

 

 


참고

 

https://ko.wikipedia.org/wiki/%EB%A7%A4%EA%B0%9C%EB%B3%80%EC%88%98

 

매개변수 - 위키백과, 우리 모두의 백과사전

매개변수(媒介變數), 파라미터(parameter), 모수(母數)는 수학과 통계학에서 어떠한 시스템이나 함수의 특정한 성질을 나타내는 변수를 말한다. 일반적으로는 θ라고 표현되며, 다른 표시는 각각 독

ko.wikipedia.org

 

https://en.wikipedia.org/wiki/Argument_of_a_function

 

Argument of a function - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search Input to a mathematical function In mathematics, an argument of a function is a value provided to obtain the function's result. It is also called an independent variable.[1] For exampl

en.wikipedia.org

 

https://wikidiff.com/parameter/element

 

Element vs Parameter - What's the difference?

As nouns the difference between element and parameter is that element is element (part of a whole) while parameter is...

wikidiff.com

https://www.ibm.com/docs/ko/icos/12.9.0?topic=functions-element

https://www.computerhope.com/jargon/e/element.htm

 

What is an Element?

Computer dictionary definition of what element means, including related links, information, and terms.

www.computerhope.com

 

한국말이 제일 어렵네요...

엘리먼트에 대한 설명이 가장 적었던 것 같아서 제일 헷갈렸던 것 같습니다..

 

 

728x90

'지식' 카테고리의 다른 글

Test Double (테스트 더블)  (0) 2023.06.19
OSI 7계층  (0) 2022.04.23
PM과 PMO  (0) 2022.04.01

댓글