Embedded C/C++

Moderators: Lundin
Number of threads: 209
Number of posts: 392

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
how to declare a define external to another module Posted by witchhazel on 29 Sept 2009 at 4:41 PM
If you have a define in one file/module and want to use the same define in another file/module without duplicating the define, how do you indicate it is an external define?
Report
Re: how to declare a define external to another module Posted by rasmiranjanbab on 3 Nov 2009 at 3:57 AM
In one file write
e.g

extern int i;
and in another file just write int i.

after seeing extern keyword by compiler, compiler will come to know that this variable is used or declared somewhere else in this module.

I hope this helps..

Regards,
R. R. Nayak



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.