ref : Coding my world!
1 void (*theUboot)(void);
。。。。
theUboot = (void (*)(void))(0x30700000);
*theUboot();
。。。。。
2 (*(void (*)(void))(0x30700000))();
。。。。
theUboot = (void (*)(void))(0x30700000);
*theUboot();
。。。。。
2 (*(void (*)(void))(0x30700000))();
函数指针以前感觉很虚,没见过真的例子,这次见了一个,果然觉得很有妙用啊,刚开始看的不太懂,后经过trio的讲解,再结合上的高级c语言课,现在有点懂了,theUboot = (void (*)(void))(0x30700000)这句话是把0x30700000这个绝对地址转换为一个函数指针赋值给theUboot,然后再引用下theUboot所指向的函数,猛,这对只知道函数入口地址的特殊函数,像没有声明过的,或不在同一个工程的函数的调用应该很有用,学习下,呵呵
ref : Coding my world!
沒有留言:
張貼留言