手机版
热门标签
站点地图
我要投稿
广告合作
联系我们
搜 索
广告位招租
广告位招租
切换导航
首页
人工智能
编程教程
编程导航
编程百科
编程问答
编程博文
编程实例
硬件设备
网络运营
软件教程
移动数码
办公软件
操作系统
网络运维
技术频道
▸ 编程语言
▸ 前端开发
▸ 移动开发
▸ 开发工具
▸ 程序设计
▸ 行业应用
▸ CMS系统
▸ 服务器
▸ 数据库
公众号推荐
微信公众号搜
"智元新知"
关注
微信扫一扫可直接关注哦!
function-pointers
function-pointers专题提供function-pointers的最新资讯内容,帮你更好的了解function-pointers。
c – 如何动态创建函数数组?
如果我想拥有一个指向函数的指针数组并且从一开始就不知道数组的大小,该怎么办?我只是好奇是否有办法做到这一点.使用新的声明或其他东西.看起来很像的东西 void (* testArray[5])(void *) = new void ()(void *); 你可以使用std :: vector: #include <vector> typedef void (*FunPointer)(void *
作者:佚名 时间:2019-12-09
c – 在C中模拟std :: bind
我正在使用std :: bind来提供回调,同时通过首先绑定一些参数来抽象一些逻辑.即 void start() { int secret_id = 43534; //Bind the secret_id to the callback function object std::function<void(std::string)> cb = std::bind(&ca
作者:佚名 时间:2019-12-11
从结构调用C成员函数指针
我已经找到了有关调用C成员函数指针和在结构中调用指针的信息,但我需要调用一个存在于结构内部的成员函数指针,并且我无法使语法正确.我在MyClass类的方法中有以下代码段: void MyClass::run() { struct { int (MyClass::*command)(int a, int b); int id; } functionMa
作者:佚名 时间:2019-12-19
c – 如何将成员函数传递给函数指针?
class Child; class Parent { public: void (*funcPointer)(); void (*funcPointer2)(Parent* _this); void (Child::*funcPointer3)(); }; class Child: public Parent { public: void TestFunc(){ }
作者:佚名 时间:2019-12-29
c – 如何散列和比较指向成员函数的指针?
我如何散列(std :: tr1 :: hash或boost :: hash)一个c指针指向成员函数? 例: 我有几个bool(Class :: * functionPointer)()(不是静态的)指向类Class的几个不同的方法,我需要散列那些指向成员函数的指针. 我怎样才能做到这一点? 另外我如何比较(std :: less)那些成员函数指针,以便我可以将它们存储在std :: set中?
作者:佚名 时间:2020-01-03
这个C语法是什么意思?
这来自我正在使用的“神奇”数组库. void sort(magic_list *l, int (*compare)(const void **a, const void **b)) { qsort(l->list, l->num_used, sizeof(void*), (int (*)(const void *,const void *))compare); } 我的问
作者:佚名 时间:2020-01-03
c – 将函数指针存储在std :: function中
我试图在dlopen()/ dlsym()周围编写一个C 0x包装来动态地从共享对象加载函数: class DynamicLoader { public: DynamicLoader(std::string const& filename); template<class Signature> std::function<Signature> load(std::
作者:佚名 时间:2020-01-08
c – 在lambda函数中捕获和传递参数之间的差异
我理解lambda功能和它在c 11中的目的.但是我不明白“捕获值”和“传递参数”之间的区别. 例如.. #include <iostream> #include <functional> using namespace std; int add(int a,int b){ return a+b; } int main(int argc, char** argv){ func
作者:佚名 时间:2020-01-10
c – 为什么无法将函数指针与模板函数进行比较?
请考虑以下代码: void func(int) {} template<typename T> void templatedFunc(T) {} int main() { void (*p)(int) = func; bool test1 = p==func; //bool test2 = p==templatedFunc<int>; // compilation err
作者:佚名 时间:2020-01-10
c – 传递给模板函数时lambda自动衰减到函数指针
有没有办法使lambda衰减到指针,而没有明确地转换为正确的签名?这将整理一些代码: template<typename T> T call(T(*func)()){ return func(); } int ptr(){ return 0; } int main(){ auto ret1 = call(ptr); auto ret2 = call((int(*)())([]{ r
作者:佚名 时间:2020-01-15
c – 有一个对象的“模拟”,但是对于函数?
我已经搜索了引用和一般的网络,但是如果存在,我无法找出. 有没有办法在C中获取当前函数的指针?这是微不足道的,它应该存在. 在完美的世界中,我想要找到一种获取当前函数的std ::函数的方法,但是即使是一个旧的样式指针也可以. 为了澄清为什么可能需要:我正在考虑Lambda函数中的递归或函数中的一般递归,在未来版本中名称更改的潜力很大. 一般你不能.例如,在可以转换为原始函数指针的lambda中,
作者:佚名 时间:2020-01-15
C向成员函数调用指针
我有一个指针到成员函数的列表,但我有一个困难的时间尝试调用这些函数…什么是正确的语法? typedef void (Box::*HitTest) (int x, int y, int w, int h); for (std::list<HitTest>::const_iterator i = hitTestList.begin(); i != hitTestList.end(); ++i) {
作者:佚名 时间:2020-01-17
C/C++中的功能编程?
我一直在读这篇文章: http://en.wikipedia.org/wiki/Function_pointer,有点困惑.由于C/C++支持函数指针,这是不是意味着他们一般支持功能编程?请注意,我实际上并不想使用C或C进行功能编程,但我很好奇,因为我从来没有听说C或C支持这样的事情. (我知道C中存在许多功能编程语言的编译器,但这并不是我的意思是“支持”). 编辑:我不知道为什么这个答案会这么讨
作者:佚名 时间:2019-07-03
使用可变模板在C中包装一个函数指针
问题 我有一些C函数void f(),R g(T a),S h(U a,V b)等等.我想编写一个模板函数,它接受f,g,h等作为模板参数,并调用该函数. 我想要这样的东西: template<MagicStuff, WrappedFunction> ReturnType wrapper(MagicallyCorrectParams... params) { extra_processin
作者:佚名 时间:2019-06-30
C编程,错误:被调用的对象不是函数或函数指针[已关闭]
我正在尝试编写一个实现Pop和Push功能的程序.问题是,我试图将指向整数Top的指针传递给函数,这样整数不断变化,但是当我尝试编译时,我总是得到这个行: **error: called object is not a function or function pointer (*t)– #include<stdio.h> #include<stdlib.h> #define MAX 10 in
作者:佚名 时间:2019-06-26
C:如何将函数存储到变量中?
我觉得他们叫做医生? (有一阵子了) 基本上,我想存储指向一个变量中的函数的指针,所以我可以从命令行指定要使用的函数. 所有函数返回并获取相同的值. unsigned int func_1 (unsigned int var1) unsigned int func_2 (unsigned int var1) function_pointer = either of the above? 所以我可
作者:佚名 时间:2019-06-17
在C中援引lambdas的方法是最惯用的?
我注意到lambdas都使用函数指针以及使用g的专用函数类型. #include <functional> typedef int(*fptr)(int, int); int apply_p(fptr f, int a, int b) { return f(a, b); } int apply_f(std::function<int(int, int)> f, int a, int b)
作者:佚名 时间:2019-06-13
c – Callable概念与std :: is_function类型特征有什么区别?
C 17将有一个 Callable的概念,我想知道与 std::is_function<T>::value是真实的类型是完全不同的.他们是等同的吗?一个是另一个的超集吗? C++17 will have a Callable concept 自从C 11以来在标准中. Are they equivalent? Is one a superset of the other? 不,其实他们是完全不相交
作者:佚名 时间:2019-06-07
C:如何将函数(不知道其参数)传递给另一个函数?
我正在尝试创建一个函数,它将存储和重复给定为特定时间或重复给定值的参数的另一个函数. 但是当你想传递一个函数作为参数时,你必须先掌握所有的参数. 如果我想将函数作为一个参数传递给函数,而另一个参数又如何呢? void AddTimer(float time, int repeats, void (*func), params); // I know params has no type and t
作者:佚名 时间:2019-06-06
递增函数指针
我刚刚了解了函数指针(指向存储函数的机器代码的地址的指针).这让我想到机器代码以及它如何存储在内存中. 机器代码是否连续存储在内存中,以便可以“手动”增加指针,直到指向以下/之前的功能? 这是一个调试器呢?他让我“看”程序计数器指向机器代码的位置? 结论:可以用函数指针编程一个原始调试器? 我明白了这个权利,还是我要走了? 有点.你假设函数将以与源代码相同的方式在内存中进行布局.很可能,他们不会
作者:佚名 时间:2019-05-22
上一页
6
7
8
9
10
11
12
13
14
下一页
小编推荐
苹果市值2025年有望达4万亿美元
• 联想拯救者新一代Y700平板通过IMDA认证
• 最新AI生图模型Flux1.1刷屏!添加单反相
• 联发科天玑 9400 频率敲定,3.626GHz 最
• 苹果新品发布会来了!5款产品面临停产
• 佳能R5C Mark II配置曝光:双系统设计,
• AI应用的东风,奥特曼不想错过
• 为新品让路!苹果定制版Mac发货延期
热门标签
更多
python
JavaScript
java
HTML
PHP
reactjs
C#
Android
CSS
Node.js
sql
r
python-3.x
MysqL
jQuery
c++
pandas
Flutter
angular
IOS
django
linux
swift
typescript
路由器
JSON
路由器设置
无线路由器
h3c
华三
华三路由器设置
华三路由器
电脑软件教程
arrays
docker
软件图文教程
C
vue.js
laravel
spring-boot