LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-12-2005, 11:05 PM   #1
carthyc
LQ Newbie
 
Registered: Apr 2005
Location: India
Distribution: Redhat 9
Posts: 17

Rep: Reputation: 0
inline function and macros in C++


Hello,

Can anybody tell me the difference between inline function and macros in C++? Which one is efficient?

Thanks in advance.
 
Old 05-13-2005, 04:03 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Fundementally I guess you could consider them equivlents. Inline functions are way clearer then macros and just as efficient to use. The creation of inline functions pretty much makes using macro obsolete.... at least as far as using macros that have logic in them.
 
Old 05-14-2005, 12:16 AM   #3
moniker117
Member
 
Registered: May 2005
Location: Los Angeles, CA, USA
Distribution: Arch
Posts: 48

Rep: Reputation: 15
Hi,

Hmm... aren't macros considered lower level than c++ inline functions, or something like that? I would imagine that macros would be more efficient than inline functions.

moniker117
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
inline function means alaios Programming 9 08-31-2005 07:03 AM
Defining a non-inline function inside class definition (tm) Programming 6 05-11-2005 09:14 AM
[SOLVED] C++ inline function: Use or don't use? druuna Programming 7 09-13-2004 04:08 PM
Calling my function through MACROS in OpenOfficeWriter mcp_achindra Linux - Software 0 07-05-2004 06:56 AM
gcc: compilation with extern inline function philipsyyy Linux - Software 0 10-13-2002 11:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration