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. linux下如何不编译opencv的某些模块

    opencv非常庞大,有很多模块,但大部分情况我们可能只会用到三四个模块,此时如果还是直接cmake . & make,将会非常费时,尤其是部署时很麻烦. 所以需要去除掉一些不需要的模块,可参 ...

  2. PLSQL_基础系列02_分组函数GROUP BY / ROLLUP / CUBE(案例)

    2014-11-30 Created By BaoXinjian

  3. Codeforces Round #367 (Div. 2) Hard problem

    Hard problem 题意: 有n个字符串,对第i个字符串进行反转操作代价为ci. 要使n个字符串按照字典序从小到大排列,最小的代价是多少. 题解: 反转就是reverse操作,比如说45873反 ...

  4. Standing on Shouder of Giants

    Zachary_Fan 如何一步一步用DDD设计一个电商网站(二)-- 项目架构 http://www.cnblogs.com/Zachary-Fan/p/6012454.html HTTP 权威指南 ...

  5. python (10) 文件夹的创建与文件夹的删除

    有时需要在代码中对文件或者文件夹 进行删除,或者添加 导入的包:import os,shutil 新建文件夹 import os,shutil path = os.getcwd() #获得当前目录 # ...

  6. SteamVR Unity工具包(VRTK)之控制器交互

    可交互对象(VRTK_InteractableObject) 可交互对象脚本被添加到需要用(如控制器)来交互的任何游戏对象上.   可用脚本参数如下   Touch Interactions 触摸交互 ...

  7. jQuery图片延迟加载插件jQuery.lazyload

      插件描述:jQuery图片延迟加载插件jQuery.lazyload,使用延迟加载在可提高网页下载速度.在某些情况下,它也能帮助减轻服务器负载. 使用方法 引用jquery和jquery.lazy ...

  8. 客户端获取服务端自定义类数据 z

    客户端获取服务端自定义类数据 问题一:超时问题,在最后获取数据的时候突然提示服务超时,服务已断开 解决:配置文件添加: <bindings> <wsHttpBinding> & ...

  9. 改变select组件的option选中状态的快捷方法

    以前我都是在<option>标签处通过判断value是否与其中一个相同然后输出selected="selected"来处理的,今天发现可以直接能过Js改变<sel ...

  10. java基础-final