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. Debug program crash with dump file.

    1. Task manager, -> find the process for the program which crashed. 2. Right click the process -& ...

  2. communication ports in DOS systems:

    : CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7,COM8, COM9, LPT1, LPT2, LPT3, LPT4, L ...

  3. PLSQL_闪回操作6_Flashback Database

    2014-12-09 Created By BaoXinjian

  4. PLSQL_闪回操作1_Flashback Query

    2014-07-02 Created By BaoXinjian

  5. NeHe OpenGL教程 第二十八课:贝塞尔曲面

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...

  6. 转_Java中常用的设计模式总结

    1.工厂模式:客户类和工厂类分开.消费者任何时候需要某种产品,只需向工厂请求即可.消费者无须修改就可以接纳新产品.缺点是当产品修改时,工厂类也要做相应的修改.如:如何创建及如何向客户端提供. 2.建造 ...

  7. webview和 内置浏览器的调用

    http://blog.csdn.net/hudashi/article/details/8176298/ 一.启动android默认浏览器 在Android程序中我们可以通过发送隐式Intent来启 ...

  8. 树莓派用USB蓝牙适配器连接蓝牙设备

    下面分享如何配置蓝牙设备.1.连接蓝牙适配到Rpi板子usb上,安装相关蓝牙服务器和驱动 lsusb 查看设备是不是被发现 pi @RaspberryPi ~ $ lsusb Bus 001 Devi ...

  9. eclipse中安装tomcat插件

    一.软件下载 Eclipse3.6 IDE for Java EE Developers: 下载地址:http://eclipse.org/downloads/ Tomcat Eclipse Plug ...

  10. linux内核hash list

    源码: #ifndef _LINUX_HLIST_H #define _LINUX_HLIST_H /* * Double linked lists with a single pointer lis ...