Troudeloup
asked on
#include <mycode>
#include <windows.h>
is useful.
i have lots of function i want to use, but i don't want to having to copy them all over my codes that use them,
how do I #include to use them?
they are only functions like this:
#include <iostream>
#include <windows.h>
#include <fstream>
#include <string>
using namespace std;
void mousemove( HWND hwnd1, int a, int b );
int main ()
{
return 0;
}
void mousemove( HWND hwnd1, int a, int b )
{
POINT p;
p.x = a;
p.y = b;
ClientToScreen( hwnd1, &p );
SetCursorPos( p.x, p.y );
}
is useful.
i have lots of function i want to use, but i don't want to having to copy them all over my codes that use them,
how do I #include to use them?
they are only functions like this:
#include <iostream>
#include <windows.h>
#include <fstream>
#include <string>
using namespace std;
void mousemove( HWND hwnd1, int a, int b );
int main ()
{
return 0;
}
void mousemove( HWND hwnd1, int a, int b )
{
POINT p;
p.x = a;
p.y = b;
ClientToScreen( hwnd1, &p );
SetCursorPos( p.x, p.y );
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
also, if I use window.h in more than one cpp, would more than one window.h get includes?
i don't want to increase the compiled file size unnecesarrily.
i don't want to increase the compiled file size unnecesarrily.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
#include "n.h"
and in n.cpp itself?
but i didn't create n.h, does it mean the compiler would generate .h from .cpp involved automatically?
and in n.cpp itself?
but i didn't create n.h, does it mean the compiler would generate .h from .cpp involved automatically?
ASKER
g++ -o main.exe main.cpp 1.cpp 2.cpp 3.cpp // and so on to compile them?
#include "n.h"
I include this line in n.cpp and main.cpp?
or every cpp involved?