cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Is it possible to create functions and u
Is it possible to create functions and use them in a separate file?
Jan 31, 2013 at 12:57am
Jan 31, 2013 at 12:57am UTC
inc0001
(17)
HI! I'm just curious to know that is it possible to make functions in a separate source file and use them? If it is, how do I do it?
Jan 31, 2013 at 1:42am
Jan 31, 2013 at 1:42am UTC
TheIdeasMan
(6843)
Yes, read this:
http://www.cplusplus.com/doc/tutorial/classes/
The C approach is to use the extern keyword, and include the header file.
http://en.wikipedia.org/wiki/External_variable
However, try to stick to the C++ stuff, unless you have to write C. Try to avoid mixing C++ and C.
Hope all goes well.
Jan 31, 2013 at 2:08am
Jan 31, 2013 at 2:08am UTC
inc0001
(17)
YOU DA MAN, IDEASMAN!
Jan 31, 2013 at 2:08am
Jan 31, 2013 at 2:08am UTC
inc0001
(17)
THANK YOU!
Jan 31, 2013 at 5:05am
Jan 31, 2013 at 5:05am UTC
TheIdeasMan
(6843)
No worries - any time. I wish the rest of my life was that easy!!
Topic archived. No new replies allowed.