i was trying to make a program which calls an batch file by giving it a parameter. the main error is i am not able to pass/send the value/string of character to the batch file. when i run it displays the name of the char(or whatever it is called) but i want it to display the string stored in that char. the source code of the c program is:-
#include <stdio.h>
#include <stdlib.h>
void main(char a)
{
a="hello sir";
system("batch.bat a");
}
and the code for batch file is:-
@echo off
SET x=
SET x=%x%%1
ECHO %x%
PAUSE
save this file as batch.bat and run the c program. the output just displayed "a" not the value of a("hello sir") and i want it to display "hello sir" pleas try and answer as fast as possible.:-)
main
is remotely standard compliant (well, besides the name). – WhozCraigsystem("batch.bat " + a);
however I'm not sure aboutsystem()
function inC/C++
– JosefZ