0
이 C 함수를 고려 다음 제조 함수 지연된 long *
출력 변수에 대한 포인터를 저장하기 위해 사용된다이중 함수로 인수를 바인딩하는 방법은 무엇입니까?
#define INDICATE_SPECIAL_CASE -1
void prepare (long *length_or_indicator);
void execute();
.
은 다음과 같이 C에서 사용할 수 있습니다
int main (void) {
long length;
long indicator;
prepare (out length, out indicator);
execute();
if (indicator == INDICATE_SPECIAL_CASE) {
// do something to handle special case
}
else {
// do something to handle the normal case which has a length
}
}
가 어떻게 발라에서 prepare()
및 INDICATE_SPECIAL_CASE
바인딩 작성 :
int main (void) {
long length_or_indicator;
prepare (&length_or_indicator);
execute();
if (length_or_indicator == INDICATE_SPECIAL_CASE) {
// do something to handle special case
}
else {
long length = lengh_or_indicator;
// do something to handle the normal case which has a length
}
}
내가 발라에서이 같은 일을 달성하기 위해 노력하고 있어요?
변수를 두 개로 분할 할 수 있습니까?
out
변수를 prepare()
(execute()
)으로 호출 한 후 변수에 쓸지라도 포인터를 사용하지 않도록 할 수 있습니까?