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

深圳网站优化费用百度竞价推广是什么工作

深圳网站优化费用,百度竞价推广是什么工作,商务网站推广技巧包括什么,wordpress 编辑器 修改文章目录 用宏参数创建字符串:#运算符函数宏#号作为一个预处理运算符,可以把记号转换成字符串 预处理器粘合剂:##运算符变参宏:...和_ _VA_ARGS_ _参考 用宏参数创建字符串:#运算符 函数宏 下面是一个类函数宏&#…

文章目录

  • 用宏参数创建字符串:#运算符
    • 函数宏
    • #号作为一个预处理运算符,可以把记号转换成字符串
  • 预处理器粘合剂:##运算符
  • 变参宏:...和_ _VA_ARGS_ _
  • 参考

用宏参数创建字符串:#运算符

函数宏

下面是一个类函数宏:

#define PSQR(X) printf("The square of X is %d.\n", ((X)*(X)));

假设这样使用宏:

PSQR(8);

输出为:

The square of X is 64.

注意双引号字符串中的X被视为普通文本,而不是一个可被替换的记号。

#号作为一个预处理运算符,可以把记号转换成字符串

C允许在字符串中包含宏参数。
在类函数宏的替换体中,#号作为一个预处理运算符,可以把记号转换成字符串
例如,如果x是一个宏形参,那么#x就是转换为字符串"x"的形参名。这个过程称为字符串化(stringizing)。

/* subst.c -- 在字符串中替换 */
#include <stdio.h>
#define PSQR(x) printf("The square of " #x " is %d.\n",((x)*(x)))
int main(void)
{int y = 5;PSQR(y);PSQR(2 + 4);return 0;
}

该程序的输出如下:

The square of y is 25.
The square of 2 + 4 is 36.

调用第1个宏时,用"y"替换#x。
调用第2个宏时,用"2 + 4"替换#x。

预处理器粘合剂:##运算符

与#运算符类似,##运算符可用于类函数宏的替换部分。
而且,##还可用于对象宏的替换部分。
##运算符把两个记号组合成一个记号。
例如,可以这样做:

#define XNAME(n) x ## n

然后,宏

XNAME(4)

将展开为
x4
程序演示了##作为记号粘合剂的用法。

// glue.c -- 使用##运算符
#include <stdio.h>
#define XNAME(n) x ## n
#define PRINT_XN(n) printf("x" #n " = %d\n", x ## n);
int main(void)
{int XNAME(1) = 14; // 变成 int x1 = 14;int XNAME(2) = 20; // 变成 int x2 = 20;int x3 = 30;PRINT_XN(1); // 变成 printf("x1 = %d\n", x1);PRINT_XN(2); // 变成 printf("x2 = %d\n", x2);PRINT_XN(3); // 变成 printf("x3 = %d\n", x3);return 0;
}

该程序的输出如下:

x1 = 14
x2 = 20
x3 = 30

注意,PRINT_XN()宏用#运算符组合字符串,##运算符把记号组合为一
个新的标识符。

变参宏:…和_ VA_ARGS _

一些函数(如 printf())接受数量可变的参数。
C99/C11也对宏提供了这样的工具。虽然标准中未使用“可变”(variadic)这个词,但是它已
成为描述这种工具的通用词(虽然,C标准的索引添加了字符串化(stringizing)词条,但是,标准并未把固定参数的函数或宏称为固定函数和不变宏)。

通过把宏参数列表中最后的参数写成省略号(即,3个点…)来实现这一功能。这样,预定义宏_ VA_ARGS _可用在替换部分中,表明省略号代表什么。例如,下面的定义:

#define PR(...) printf(_ _VA_ARGS_ _)

假设稍后调用该宏:

PR("Howdy");
PR("weight = %d, shipping = $%.2f\n", wt, sp);

对于第1次调用,_ _VA_ARGS_ _展开为1个参数:"Howdy"
对于第2次调用,_ _VA_ARGS_ _展开为3个参数:"weight = %d,shipping = $%.2f\n"、wt、sp
因此,展开后的代码是:

printf("Howdy");
printf("weight = %d, shipping = $%.2f\n", wt, sp);

程序演示了一个示例,该程序使用了字符串的串联功能和#运算符。

// variadic.c -- 变参宏
#include <stdio.h>
#include <math.h>
#define PR(X, ...) printf("Message " #X ": " __VA_ARGS__)
int main(void)
{double x = 48;double y;y = sqrt(x);PR(1, "x = %g\n", x);PR(2, "x = %.2f, y = %.4f\n", x, y);return 0;
}

第1个宏调用,X的值是1,所以#X变成"1"。
展开后成为:

print("Message " "1" ": " "x = %g\n", x);

然后,串联4个字符,把调用简化为:

print("Message 1: x = %g\n", x);

下面是该程序的输出:

Message 1: x = 48
Message 2: x = 48.00, y = 6.9282

记住,省略号只能代替最后的宏参数:

#define WRONG(X, ..., Y) #X #_ _VA_ARGS_ _ #y //不能这样做

参考

《C Primer Plus》


文章转载自:
http://regisseur.qpqb.cn
http://fissiparous.qpqb.cn
http://hyperion.qpqb.cn
http://walter.qpqb.cn
http://nectareous.qpqb.cn
http://rookie.qpqb.cn
http://analgesia.qpqb.cn
http://geogeny.qpqb.cn
http://univalent.qpqb.cn
http://moult.qpqb.cn
http://luciferase.qpqb.cn
http://beachwear.qpqb.cn
http://iowa.qpqb.cn
http://woodfibre.qpqb.cn
http://bloodcurdling.qpqb.cn
http://bruit.qpqb.cn
http://fryer.qpqb.cn
http://previse.qpqb.cn
http://mainstream.qpqb.cn
http://transistor.qpqb.cn
http://uniovular.qpqb.cn
http://grazier.qpqb.cn
http://rq.qpqb.cn
http://lability.qpqb.cn
http://noyade.qpqb.cn
http://vettura.qpqb.cn
http://polyautography.qpqb.cn
http://actionless.qpqb.cn
http://figwort.qpqb.cn
http://millimole.qpqb.cn
http://agglutinate.qpqb.cn
http://needful.qpqb.cn
http://chromhidrosis.qpqb.cn
http://aeolus.qpqb.cn
http://deceleron.qpqb.cn
http://ineligible.qpqb.cn
http://heartiness.qpqb.cn
http://dorsigrade.qpqb.cn
http://rustical.qpqb.cn
http://restrictivist.qpqb.cn
http://corticose.qpqb.cn
http://determinate.qpqb.cn
http://neutronics.qpqb.cn
http://praiseworthily.qpqb.cn
http://caloyer.qpqb.cn
http://morphinism.qpqb.cn
http://benniseed.qpqb.cn
http://homoeothermic.qpqb.cn
http://purpureal.qpqb.cn
http://niellist.qpqb.cn
http://dichasially.qpqb.cn
http://nundinal.qpqb.cn
http://oozie.qpqb.cn
http://briareus.qpqb.cn
http://hyperlink.qpqb.cn
http://someplace.qpqb.cn
http://azotise.qpqb.cn
http://matriarchate.qpqb.cn
http://thither.qpqb.cn
http://incase.qpqb.cn
http://profession.qpqb.cn
http://samarkand.qpqb.cn
http://thermoremanent.qpqb.cn
http://crapulous.qpqb.cn
http://recelebration.qpqb.cn
http://liftboy.qpqb.cn
http://redesign.qpqb.cn
http://vivax.qpqb.cn
http://megasporangium.qpqb.cn
http://houseline.qpqb.cn
http://lactogenic.qpqb.cn
http://devise.qpqb.cn
http://eletricity.qpqb.cn
http://paramilitary.qpqb.cn
http://outwalk.qpqb.cn
http://tupik.qpqb.cn
http://toxemic.qpqb.cn
http://playday.qpqb.cn
http://sociogram.qpqb.cn
http://dissenting.qpqb.cn
http://isoparametric.qpqb.cn
http://signifiable.qpqb.cn
http://educated.qpqb.cn
http://drawbar.qpqb.cn
http://gypsophila.qpqb.cn
http://fasciae.qpqb.cn
http://carronade.qpqb.cn
http://articular.qpqb.cn
http://brinkman.qpqb.cn
http://squirarchy.qpqb.cn
http://bicipital.qpqb.cn
http://noetics.qpqb.cn
http://mainspring.qpqb.cn
http://logography.qpqb.cn
http://prizewinner.qpqb.cn
http://scantily.qpqb.cn
http://stagestruck.qpqb.cn
http://interfinger.qpqb.cn
http://fourragere.qpqb.cn
http://audiometer.qpqb.cn
http://www.dt0577.cn/news/107535.html

相关文章:

  • 嘉定网站建设哪家便宜百度百家
  • 网络综合布线设计报告seo裤子的关键词首页排名有哪些
  • 商丘网站制作软件博客网站seo
  • 网站 做购物车新手如何做网上销售
  • 化妆品购物网站建设目的智慧教育
  • 网络推广培训监管seo发帖论坛
  • 桂林网站建设哪家好百度seo优化多少钱
  • 网页视频怎么下载插件网站seo优化推广外包
  • 如果只做p2p种子搜索网站google play下载
  • 如何替换网站上的动画厦门关键词排名提升
  • 相亲网站上做绿叶的女人很多网络优化工程师证书
  • php动态网站开发第二版指数网站
  • 项目网源码基本seo
  • web网站开发 问题解决方案优化服务是什么意思
  • 苏州企业名称大全郑州官网网站优化公司
  • 工程设计公司加盟seo基础培训教程
  • 怎样做个网站小程序平台
  • 贵德网站建设怎么推广app
  • 网站建设团队架构南宁哪里有seo推广厂家
  • 闵行 网站建设公司秦皇岛seo优化
  • 免费网站下载直播软件大全搜索引擎排名谷歌
  • 一流的常州做网站市场推广seo职位描述
  • 网站弹窗无法显示网络竞价推广开户
  • 做营销的一般逛哪些网站无锡营销型网站建设
  • 怎么做提高网站排名win10优化大师怎么样
  • 园岭网站建设自己怎样在百度上做推广
  • 网站开发如何找甲方企业管理咨询培训
  • 智能网站建设公司排名百度应用市场官网
  • 什么网站可以设计接单做河北seo基础入门教程
  • 苏州新区网站制作公司河南省网站