M
Mohsen
Hello Everybody,
I have a main program and I would like to include another program
(MN.h) inside my main program. I already know how to use "extern"
for the variables that I have defined as int, double ... in my main
program to use the information of my main program in the program that I
want to include in my main program however I have some variables that I
have used "#define" in my main program but I don't know how I
should use extern for the variable which I have used "#define" for
them. For example in the follwing main program I know how to use extern
to define "int AS" and "int AD" and I have shown how I have
used extern in the other program but I don't know how to use extern
for "M" and "R".
Is there anybody to tell me how I can do that?
Thanks,
MY MAIN PROGRAM:
#include <stdio.h>
#include <stdlib.h>
#include "MN.h"
#define M
#define R
int AS;
int AD;
..
..
..
..
MN.h program that I want to include:
#include <stdio.h>
#include <stdlib.h>
extern int AS;
extern int AD;
..
..
..
..
..
I have a main program and I would like to include another program
(MN.h) inside my main program. I already know how to use "extern"
for the variables that I have defined as int, double ... in my main
program to use the information of my main program in the program that I
want to include in my main program however I have some variables that I
have used "#define" in my main program but I don't know how I
should use extern for the variable which I have used "#define" for
them. For example in the follwing main program I know how to use extern
to define "int AS" and "int AD" and I have shown how I have
used extern in the other program but I don't know how to use extern
for "M" and "R".
Is there anybody to tell me how I can do that?
Thanks,
MY MAIN PROGRAM:
#include <stdio.h>
#include <stdlib.h>
#include "MN.h"
#define M
#define R
int AS;
int AD;
..
..
..
..
MN.h program that I want to include:
#include <stdio.h>
#include <stdlib.h>
extern int AS;
extern int AD;
..
..
..
..
..