Download presentation
Presentation is loading. Please wait.
Published byMarcus Baldwin Modified over 9 years ago
1
by Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
2
Introduction Most of the real world programs contain more than 1 source code files. This is for modularity and manage ability. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
3
Demo Multifile C hello world. New header file creation. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
4
Some practices All declaration should be in the header files. All definitions should be in the Source Files. Declarations are things which complier look for. Definitions are things which linker look for. So normally header file and C files are pairs. Like mymodule1.h ( contains all the declarations of variables and functions) and mymodule.cpp ( contains all the definitions of variables and functions ) SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
5
keyword extern For declaring global variable which are defined in other C files. static keyword for file scope. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
6
Demo Declaration and definition distinguished. Generation of complier error and link error. Global variables and extern keyword. static variable scope. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
7
Thank you SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.