G
Size: a a a
G
AM
IZ
G
IZ
AM
IZ
IZ
AM
IZ
MessageBox(nullptr, TEXT("Hello"), TEXT("Okay"), MB_OK | MB_CANCELTRYCONTINUE);
IZ
G
header.h:
inline int foo() { return 42; }
int bar();
tu1.cpp:
#include <header.h>
int bar() { return foo() * 2; }
tu2.cpp:
#include <header.h>
int main() { return bar(); }
AM
ПК
bar
определеная в tu1.cpp
. Этот вызов будет разрешён компоновщикомIZ
AM
AM
IZ
G
bar
определеная в tu1.cpp
. Этот вызов будет разрешён компоновщикомheader.h:
class Example
{
int methodOfExample();
}
header.cpp
Exmaple::methodOfExample()
{
return 11;
}
tu1.cpp:
#include <header.h>
tu2.cpp:
#include <header.h>
void main()
{
Example ex;
ex.methodOfExample();
}
C
header.h:
class Example
{
int methodOfExample();
}
header.cpp
Exmaple::methodOfExample()
{
return 11;
}
tu1.cpp:
#include <header.h>
tu2.cpp:
#include <header.h>
void main()
{
Example ex;
ex.methodOfExample();
}