macro is typeless and execute faster than funtion ,becaus of the overhead of calling and returnning of function,but macro will increase the size of program due  to many time's substitution,as well as the side effect of macro  may cause unexpected results,to avoid this ,you'd better make the arguments bracketed as possible as you can,on the contrary ,the result of function is more predicted.

macro :definitine commom argument ,little funtion such as MAX,MIN,

function :specific module or operation

getchar:    ch=getchar();     fgetc()/getc()

putchar :   putchar(ch);     fputc()/putc()

gets: gets(*str);{\n terminate, not include \n}  fgets(char *str,int n ,FILE *stream){\n terminate, include \n}only read in n-1 char the last is filled with null

puts: puts(*str);{ add \n}                               fputs(char *str,int n ,FILE *stream){not add \n}all of this function operating in line return a char *of target

scanf:          fscanf(FILE *stream,char *format,[argument])     sscanf( string str, string fmt, mixed var1, mixed var2 ... );

printf:         fprintf(FILE *stream,char *format,[argument])     sprintf( char *buffer, const char *format [, argument] … );

The difference between macro and function I/Ofunction comparision(from c and pointer )的更多相关文章

  1. C++如何使用宏定义来简化代码性能测试 | cpp macro like function to implement a performance profiler

    本文首发于个人博客https://kezunlin.me/post/65dc693d/,欢迎阅读最新内容! cpp macro like function to implement a perform ...

  2. [转] iOS ABI Function Call Guide

    source: apple ARMv6 Function Calling Conventions When functions (routines) call other functions (sub ...

  3. How to create DB2 user function easily by DB Query Analyzer 6.03

    How to create DB2user function easily by DB Query Analyzer 6.03 Ma Genfeng (Guangdong Unitoll Servic ...

  4. function multi-versioning in GCC

    https://lwn.net/Articles/691932/ https://gcc.gnu.org/wiki/FunctionMultiVersioning why multi-versioni ...

  5. C++对象模型——指向Member Function的指针 (Pointer-to-Member Functions)(第四章)

    4.4 指向Member Function的指针 (Pointer-to-Member Functions) 取一个nonstatic data member的地址,得到的结果是该member在 cl ...

  6. 剖析std::function接口与实现

    目录 前言 一.std::function的原理与接口 1.1 std::function是函数包装器 1.2 C++注重运行时效率 1.3 用函数指针实现多态 1.4 std::function的接 ...

  7. boost function bind ref

    boost::function to encapsulate function pointers. 1. function #include <boost/function.hpp> #i ...

  8. Function Overloading in C++

    In C++, following function declarations cannot be overloaded. (1)Function declarations that differ o ...

  9. [转载] what's goole mock

    原文: https://code.google.com/p/googlemock/wiki/V1_7_ForDummies 地址被墙了, 看起来费劲, 转载一份 Google C++ Mocking ...

随机推荐

  1. (C/C++) 算法,编程题

    注: 如下的题目皆来自互联网,答案是结合了自己的习惯稍作了修改. 1. 求一个数的二进制中的1的个数. int func(int x) { ; while (x) { count++; x = x&a ...

  2. [CSS]去除inline-block元素间距的几种方法

    当我们使用inline-block 时,会出现空白间距问题. 但这些间距对我们的布局,或兼容性产生影响,我们需要去除它,该怎么办?下面简单介绍几种方法: 1.去掉html元素之间的空格,直接写在一行. ...

  3. PLSQL_性能优化系列12_Oracle Index Anaylsis索引分析

    2014-10-04 Created By BaoXinjian

  4. Report_客制化报表输出Excel后去0问题(案例)

    2014-02-01 Created By BaoXinjian

  5. Java爬虫搜索原理实现

    permike 原文 Java爬虫搜索原理实现 没事做,又研究了一下爬虫搜索,两三天时间总算是把原理闹的差不多了,基本实现了爬虫搜索的原理,本次实现还是俩程序,分别是按广度优先和深度优先完成的,广度优 ...

  6. psutil模块安装指南(win与linux)

    1.windows下psutil模块安装: https://pypi.python.org/packages/3.4/p/psutil/ 下载符合版本的软件包下载,然后安装即可. 2.ubuntu下载 ...

  7. ylbtech-LanguageSamples-Threading(线程处理)

    ylbtech-Microsoft-CSharpSamples:ylbtech-LanguageSamples-Threading(线程处理) 1.A,示例(Sample) 返回顶部 “线程处理”示例 ...

  8. JAVA break终止循环,与continue进入下一次循环

    一.break终止循环 在循环中,遇到break;将会跳出循环,继续往下执行代码 public class Test{ public static void main(String[] args){ ...

  9. PHP的require()函数可以在一行代码中多次读取

    [root@NJ232:~]$[root@NJ232:~]$more tt.php m#!/opt/php/bin/php -q<?phpwhile(1){ sleep(2); $arr = r ...

  10. Gatling的进阶二

    1. 参数化     Gatling可以很方便使用csv文件进行参数化,例如一个用户信息表:   /* user_information.csv */ username,password,accoun ...