AnsweredAssumed Answered

calling functions from external files

Question asked by antony hart on Jan 19, 2011
Latest reply on Jan 19, 2011 by antony hart

Hello everybody,

 

                        Please excuse my newb question. The problem I am having is that I can't seem to call functions defined in external files. At the moment, in order to try and do so, I am using the following structure:

 

In "Main.c"

---------------------------------------------------------------

#include "header_file.h"

 

/*call function*/

<r-type> <function_name> ();

---------------------------------------------------------------

 

In "header_file.h"

--------------------------------------------------------------

/*function prototype*/

<r-type> <function_name> (<p-type> <p-name>)

--------------------------------------------------------------

 

In "file_containing_function.c"

-------------------------------------------------------------

/*define function*/

<r-type> <function_name> (<p-type> <p_name>)

{

       some_code;

}

-------------------------------------------------------------

-------------------------------------------------------------

 

The main.c file obviously already exists, however I have added both the "header_file.h" containing the function prototype; and the "file_containing_function.c" which defines my function to my project. Can somebody please explain to me why when in debug mode, I cannot view the 'stack crawl window' step through the function in the external file. It simply seems to bypass the function call altogether.

 

Thanks for your help.  

Outcomes