Function Libraries
Dumb Question...How do I create a C++ function library of my own because I am lazy and I don''t like putting in the same function protoypes in all of the time.
thanks guys
Just put all the prototypes into a header (.h or .hpp) file and then include it where you want all of the prototypes.
"I thought Genius lived in bottles..." - Patrick Star
Sort of. You don''t put the function definitions in a header, but rather in seperate .cpp file than your main source file.
-AJ
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-Comic Book Store Guy''s t-shirt that I saw on the Simpsons, although it didn''t actually come from the Simpsons.
http://vdsoft.netfirms.com/home.html
-AJ
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
-Comic Book Store Guy''s t-shirt that I saw on the Simpsons, although it didn''t actually come from the Simpsons.
http://vdsoft.netfirms.com/home.html
C:DOSC:DOSRUNRUNDOSRUN-Comic Book Store Guy's t-shirt that I saw on the Simpsons, although it didn't actually come from the Simpsons.http://vdsoft.netfirms.com/home.html
function defenitions usually go in a corresponding c or cpp file.
ie)
-eldee
;another space monkey;
[ Forced Evolution Studios ]
ie)
// test.h#ifndef TEST_H_09875659876ADSF_#define TEST_H_09875659876ADSF_int add(int a, int b);#endif// test.cpp#include "test.h"int add(int a, int b);{ return a+b;}
-eldee
;another space monkey;
[ Forced Evolution Studios ]
-eldee;another space monkey;[ Forced Evolution Studios ]
Kylotan wrote an article on this over here: organising code files (nabbed from his sig).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement