Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第一章中函数声明中列举的例子 #222

Open
qpc2015 opened this issue Sep 20, 2024 · 0 comments
Open

第一章中函数声明中列举的例子 #222

qpc2015 opened this issue Sep 20, 2024 · 0 comments

Comments

@qpc2015
Copy link

qpc2015 commented Sep 20, 2024

typedef bool CALLBACK();

//不指定返回类型,此时默认为dynamic,不是bool
isNoble(int atomicNumber) {
return _nobleGases[atomicNumber] != null;
}

void test(CALLBACK cb){
print(cb());
}
//报错,isNoble不是bool类型
test(isNoble);

isNoble同时也不满住typedef定义的无参数

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant