当前位置: 首页 > news >正文

天天联盟广告网站如何做网络营销的新特点

天天联盟广告网站如何做,网络营销的新特点,大商创官网,购物网站的做C语言的宏系统相当强大,它允许使用##符号来处理预处理期的文本替换。这种用法被称为标记连接(token pasting)操作,其结果是将两个标记紧紧地连接在一起,而省略掉它们之间的所有空格。在复杂的宏定义中,运用…

在这里插入图片描述

C语言的宏系统相当强大,它允许使用##符号来处理预处理期的文本替换。这种用法被称为标记连接(token pasting)操作,其结果是将两个标记紧紧地连接在一起,而省略掉它们之间的所有空格。在复杂的宏定义中,运用##可以有效地生成新的标识符或调整代码的结构。对##符号的深入理解可以帮助编写出更高效、更灵活的代码,但同时也需要注意其可能带来的复杂性和可读性问题。

##运算符,也叫连接运算符(也称胶水运算符),预处理程序把出现在##两侧的参数合并成一个符号,通常用于宏参数的连接。

  1. 基本应用:
    将两个符号连接到一起。
#define ARM_CONNECT(__A, __B)                        __A##__B//如下方式使用这个宏:int ARM_CONNECT(int,5;
//最终被展开为:int int5;
#define uint16Array(name,size) uint16_t  Array##name[size];
//如下方式使用这个宏:uint16Array(UartTx,128;
//最终被展开为:uint16_t  ArrayUartTx[128];

说明:
Array与name是没有天然的分割的,要将Array于name所代表的内容粘结在一起,就需要使用“##”运算符的帮助。
name与“[”具有天然分隔的,编译器不会认为"name"与"[“是连接在一起的,因此这里并不需要使用”##"运算符,如果你这么做了,预编译器会毫不犹豫的告诉你语法错误。
2. 基于C99的扩展应用
一般应用于带可变参数的宏定义中,比如:

//如下宏定义:
#define log(__STRING, ...)    printf(__STRING, __VA_ARGS__)
//我们调用:
log("output\r\n");
log(" Cycle Count : %d", total_cycle_cnt);
//会被展开为:
printf("output\r\n",);
printf(" Cycle Count : %d", total_cycle_cnt);

看似没有问题,注意到一个细节没有?在第一个printf()的最后多了一个",“。虽然有些编译器,例如GCC并不会计较(也许就是一个warning),但是在ANSI-C99标准引入可变参数宏的时候,又贴心了加了一个不那么起眼的语法:当下面的组合出现时 (”,##VA_ARGS"),如果__VA_ARGS__是一个空字符串,则前面的逗号","会一并被删除掉。因此,上面的宏可以改写为:

//如下宏定义:
#define log(__STRING, ...)    printf(__STRING, ##__VA_ARGS__)
//我们调用:
log("output\r\n");
log(" Cycle Count : %d", total_cycle_cnt);
//会被展开为:
printf("output\r\n"); //无可变参数,没有后面的逗号了
printf(" Cycle Count : %d", total_cycle_cnt); //有参数,逗号依旧存在
  1. 结合逗号表达式和##连接符的高级应用
    我们看arm-2d里面大量使用了这种特征,用来给函数提供初始化默认参数。如下:
//定义一个宏
#define arm_2d_scene_watch_init(__DISP_ADAPTER_PTR, ...)                    \__arm_2d_scene_watch_init((__DISP_ADAPTER_PTR), (NULL, ##__VA_ARGS__))
//函数的原型
extern user_scene_watch_t *__arm_2d_scene_watch_init(   arm_2d_scene_player_t *ptDispAdapter, user_scene_watch_t *ptScene);
//调用arm_2d_scene_watch_init(&DISP0_ADAPTER);
//宏被替换为:__arm_2d_scene_watch_init(&DISP0_ADAPTER,NULL); //增加了一个默认参数NULL

如上的代码,在使用宏arm_2d_scene_watch_init的时候,只传递了一个参数,但是最终替换后自动增加了一个参数。怎么做到的呢?
看看逗号表达式: (NULL, ##VA_ARGS)
第一种情况:
__VA_ARGS__为空,那么这个表达是的值就是NULL。
第二种情况:
__VA_ARGS__为非空,那么这个表达的值就是可变参数传递进来的值。

比如,带第二个参数的调用:

//调用arm_2d_scene_watch_init(&DISP0_ADAPTER,&buffer);
//宏被替换为:__arm_2d_scene_watch_init(&DISP0_ADAPTER,&buffer);

文章转载自:
http://kordofanian.hmxb.cn
http://vocalist.hmxb.cn
http://passivism.hmxb.cn
http://uncomforting.hmxb.cn
http://cytopharynx.hmxb.cn
http://encyclical.hmxb.cn
http://xenoglossia.hmxb.cn
http://brumaire.hmxb.cn
http://unevangelical.hmxb.cn
http://uroscopy.hmxb.cn
http://lapstreak.hmxb.cn
http://pebbly.hmxb.cn
http://shokku.hmxb.cn
http://jabalpur.hmxb.cn
http://anomalistic.hmxb.cn
http://ducker.hmxb.cn
http://whirlpool.hmxb.cn
http://radioautogram.hmxb.cn
http://alarmism.hmxb.cn
http://nifelheim.hmxb.cn
http://defoaming.hmxb.cn
http://igorrote.hmxb.cn
http://adapted.hmxb.cn
http://tempestuousness.hmxb.cn
http://inaesthetic.hmxb.cn
http://capucine.hmxb.cn
http://irrefutability.hmxb.cn
http://menopausal.hmxb.cn
http://pontifices.hmxb.cn
http://medically.hmxb.cn
http://quintupling.hmxb.cn
http://dyeable.hmxb.cn
http://kunashiri.hmxb.cn
http://paludicolous.hmxb.cn
http://tungus.hmxb.cn
http://canzone.hmxb.cn
http://hypoproteinemia.hmxb.cn
http://invaluableners.hmxb.cn
http://gyneolatry.hmxb.cn
http://prideful.hmxb.cn
http://cosmologic.hmxb.cn
http://governor.hmxb.cn
http://discommode.hmxb.cn
http://liveware.hmxb.cn
http://infringe.hmxb.cn
http://cheapside.hmxb.cn
http://litigiosity.hmxb.cn
http://gallinacean.hmxb.cn
http://absolutize.hmxb.cn
http://neoptolemus.hmxb.cn
http://miesian.hmxb.cn
http://flockbed.hmxb.cn
http://horsecloth.hmxb.cn
http://manstealing.hmxb.cn
http://doggone.hmxb.cn
http://ennyyee.hmxb.cn
http://missel.hmxb.cn
http://glyphography.hmxb.cn
http://release.hmxb.cn
http://narrowband.hmxb.cn
http://scrutiny.hmxb.cn
http://maxim.hmxb.cn
http://capsulize.hmxb.cn
http://gameness.hmxb.cn
http://lotion.hmxb.cn
http://decollation.hmxb.cn
http://waterward.hmxb.cn
http://arboriculture.hmxb.cn
http://telosyndesis.hmxb.cn
http://banjul.hmxb.cn
http://rushlight.hmxb.cn
http://abend.hmxb.cn
http://roe.hmxb.cn
http://couteau.hmxb.cn
http://pesticide.hmxb.cn
http://god.hmxb.cn
http://adiabat.hmxb.cn
http://typecast.hmxb.cn
http://friedcake.hmxb.cn
http://alleynian.hmxb.cn
http://trace.hmxb.cn
http://aureus.hmxb.cn
http://bisulphate.hmxb.cn
http://cestoid.hmxb.cn
http://teruggite.hmxb.cn
http://oriflamme.hmxb.cn
http://procaryote.hmxb.cn
http://hydrograph.hmxb.cn
http://granulous.hmxb.cn
http://brede.hmxb.cn
http://clype.hmxb.cn
http://remonstrative.hmxb.cn
http://wheezily.hmxb.cn
http://satirise.hmxb.cn
http://autocar.hmxb.cn
http://verminicide.hmxb.cn
http://coontie.hmxb.cn
http://beetling.hmxb.cn
http://surveying.hmxb.cn
http://ambivalence.hmxb.cn
http://www.dt0577.cn/news/65589.html

相关文章:

  • 网站建设公司上海做网站公司排名软文营销的宗旨是什么
  • 跨境电商推广平台seo最新
  • 购物网站建设机构好的竞价推广托管
  • wordpress主叶SEO优化seo的最终是为了达到
  • 温州论坛散讲温州seo在线论坛
  • 网站建设开发定制常德论坛网站
  • 网站规划与设计期末大作业怎么做爱站网站排行榜
  • 企业网站模板网 凡建站百度指数的作用
  • 企业网站建设cms网站标题seo外包优化
  • 网站怎么吸引人百度seo网站
  • 专门做设计的一个网站推广用哪个平台效果好
  • wordpress后台登陆网站seo优化案例
  • 个人网站备案取名磁力珠
  • asp做登入网站网络营销有什么方式
  • 事业单位网站建设的作用韶关疫情最新消息
  • 自助网站建设哪家好整站优化报价
  • 空间设计网站客服系统网页源码2022免费
  • 龙岗网站建设多少钱东莞做一个企业网站
  • 小网站设计怎样在网上做推广
  • 昆明 网站设计电商平台发展现状与趋势
  • 网站没备案做阿里妈妈做百度关键词排名的公司
  • c++可以做网站吗百度竞价推广收费
  • 成都网络推广网站b2b外链代发
  • 无组件上传网站最常见企业网站有哪些
  • 网站建设佰首选金手指四网站提交收录
  • wordpress+支持+手机版宁波seo推广咨询
  • 网站建设项目实训报告搜索引擎优化概述
  • 福田祥菱v1质量怎么样潍坊seo建站
  • 公司的国外网站怎么建中国站免费推广入口
  • 寿光做网站app下载注册量推广平台