C++ inline的使用
内联函数不是在调用时发生控制转移,而是在编译时将函数体嵌入在每一个调用处。
这样就节省了参数传递、控制转移等开销。
 View Code
View Code 
#include "iostream" #include "string" using namespace std; inline void print(string Str) { cout<<Str<<endl; } int main() { string Str; while(cin>>Str) print(Str); }
posted on 2012-04-19 19:37 More study needed. 阅读(169) 评论(0) 收藏 举报
 
                     
                    
                 
                    
                
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号 
