Created
May 29, 2020 09:56
-
-
Save ZikiSoy/394abf58cab924a4497c6755ddefeefe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef const char* pFunc(const char*); | |
typedef const char* (*pFunc2)(const char*); | |
const char* func1(const char * p) | |
{ | |
cout << p << endl; | |
return p; | |
} | |
int main() | |
{ | |
pFunc *c; | |
c = func1; | |
pFunc* c2 = func1; | |
pFunc* c3(func1); | |
pFunc* c4(&func1); | |
c("123"); | |
c2("123"); | |
c3("123"); | |
c4("123"); | |
// pointer to function | |
pFunc2 d1 = func1; | |
pFunc2 d2; | |
d2 = func1; | |
d1("123"); | |
d2("123"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment