define function int abc(int a, float b).
You create abc.h and input this there:
#ifndef abc
#define abc
int abc(int a, float b);
#endif abc
You create also abc.c:
#include "abc.h" // PAY ATTENTION TO THE H HERE
int abc(int a, float b) {
return a - (int)b;
}
Then, you use it in file such as main.cpp like:
#include <iostream>
#include "abc.h" // PAY ATTENTION TO THE H HERE
int main() {
std::cout << a(1, 4.0) << std::endl;
}
thank you so much:)
Обсуждают сегодня