One Definition Rule - Multiple definition of inline functions : <p>I was reading ODR and as the rule says <code>"In the entire program, an object or non-inline function cannot have more than one definition"</code> and I tried the following...</p>

<p>file1.cpp</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

inline int func1(void){ return 5; }
inline int func2(void){ return 6; }
inline int func3(void){ return 7; }
int sum(void);

int main(int argc, char *argv[])
{
    cout &lt;&lt; func1() &lt;&lt; endl;
    cout &lt;&lt; func2() &lt;&lt; endl;
    cout &lt;&lt; func3() &lt;&lt; endl;
    cout &lt;&lt; sum() &lt;&lt; endl;
    return 0;
}
</code></pre>

<p>file2.cpp</p>

<pre><code>inline int func1(void) { return 5; }
inline int func2(void) { return 6; }
inline int func3(void) { return 7; }
int sum(void) { return func1() + func2() + func3(); }
</code></pre>

<p>It worked as the rule says. I can have multiple definition of inline functions. </p>

<ul>
<li>What is the difference between non-inline function linkage and inline function linkage?</li>
<li>How the linker differentiate between these two?</li>
</ul>
