November 3rd, 2012, 06:10 AM
How to remove errors in getmac program in C language?
Please find below the code and the output which I am getting.
My C code is in c:/turboc3/bin directory and my output macid.txt is in c:/turboc3/disk.
Here is the code which I am compiling
The output is:
int main ()
FILE *fp; clrscr();
Illegal command: GETMAC.
Can anyone guide me through this?
November 3rd, 2012, 06:14 AM
Your immediate problem is here
Last edited by bdb; November 3rd, 2012 at 07:29 AM.
Reason: deleted text that was no longer relevant
November 3rd, 2012, 07:00 AM
November 3rd, 2012, 07:15 AM
SYSTEM() Function works fine
the system function works fine. if instead of getmac when i write DIR the same program works as desired i.e. it properly display all the included directories in the present working directory
November 3rd, 2012, 07:34 AM
Yes, the problem is the argument passed to system().
Originally Posted by embed_ware
the system() function works fine does not mean that it works fine with any and all arguments!
Try and specifiy the full path to where GETMAC is
Also, if that fails, try with backslashes