Home > Back-end >  How to implement different in vs code in C language program between function calls to each other?
How to implement different in vs code in C language program between function calls to each other?

Time:11-26

Reference:

Solve the Visual Studio under the same project engineering call each other between different C language program problems
https://blog.csdn.net/weixin_41194129/article/details/107935039

1, the contents of the header file function. H

//# # ifndef __FUNCTION_H__
//# define __FUNCTION_H__
Int fun (int, int);
Int times (int, int);
//# endif


2, the structure of the function. The c function

# include "function. H"
Int fun (int a, int b)
{
Return a + b;
}

Int times (int a, int b)
{
Return a * b;
}


3, the main function. The main c to call the function:


# include "function. H"
Int fun (int a, int b)
{
Return a + b;
}

Int times (int a, int b)
{
Return a * b;
}

CodePudding user response:

It's not too difficult, difficult is different between architecture, different systems, the compiler is different between calls,

CodePudding user response:

Sorry, here I correct the file. The main content of c

 # include "stdio.h" 
/* # include "function. H" contains the header file */
Int main ()
{
Int a=2;
Int b=4;
Printf (" % d \ n ", fun (a, b));
Printf (" % d \ n ", times (a, b));
return 0;
}
  • Related