 |
 |
 |
 |
| Name |
|
return |
 |
|
|
| Examples |
|
int val = 30;
void setup() {
Serial.begin(9600);
}
void loop() {
int t = timestwo(val);
Serial.println(t);
}
int timestwo(int dVal) {
dVal = dVal * 2;
return dVal;
}
|
|
|
| Description |
|
Keyword used to indicate the value to return from a function. The value being returned must be the same datatype as defined in the function declaration. Functions declared with void can't return values and shouldn't include a return value. The keyword return may also be used to break out of a function thus not allowing the program to read the remaining statements (see the third example above).
함수로 부터 복귀할때
결과 값을 표시하는
예약어 입니다. 반환
값은 함수 선언시와
동일한 데이터
형이어야 합니다.
함수가 void 로 선언되면
결과 값이 없는 것이며
return 키워드는 사용할
필요가 없습니다. return 은
함수에서 더이상
남아있는 문을
실행하지 않고 끝내는
용도로 사용할 수
있습니다.
|
 |
|
|
| Syntax |
|
type function {
statements
return value
}
|
 |
|
|
| Parameters |
|
| type |
|
boolean, byte, char, int, float, String, boolean[], byte[], char[], int[], float[], String[]
|
| function |
|
any function that is being defined
|
| statements |
|
any valid statements
|
| value |
|
must be the same datatype as the type parameter 함수
선언에 사용된 데이터
형과 반드시 같은
데이터 형의 수
|
|
 |
|
|
| Usage |
|
Web & Application |
 |
|
|
|