Well i use Dev-c++ 126.96.36.199 for programming..i m using it from last two years...recently i learned java and saw that all java programs are run through command prompt. I tried tha same in c++. i saved my program in dev-cpp/bin .but i am not able to do this..what is the exact procedure please tell me.. and How to pass command line argument. Is there any limitation on the type of arguments passed to main. like i saw somewhere int main(int argc,string args)
thanks for the links...they are really useful...
but my problem is that i dont know what are commands to compile and run the cpp program..
ok see steps are
1.save file in bin
2.run command prompt
3. type in cd c:\dev-cpp\bin now i m in the same directory where the compiler and the program is saved...
now what next to compile my porgram named test.cpp
in java i know those commands they are
cd c:\program files\java\jdk1.5\bin
c:\program files\java\jdk1.5\bin> javac filename.java
c:\program files\java\jdk1.5\bin> java filename this is a test program
the line THIS IS A TEST PROGRAM in the third line is a command line argument..
i wanna know the cpp equivalent for this..
You don't have to compile it from the command prompt. In fact in the dev environment click the compile button (not the compile AND run button) and that will give you an executable. Then all you need to do navigate to that path using cd c:\dev and run your program from there.
After creating the command prompt window you have to add the dev-cpp\bin to your PATH environment then execute make.exe
c:\Dev-C++:>make -f makefile.win <Enter>
The makefile.win should have been generated by the Dev-C++ IDE. If not, then you will either have to learn how to create it manually (its a big pain in the a**) or let the IDE do it for you. Alternatively you can type all the commands in the makefile yourself each time you want to compile the program -- which is another big pain in the rear.
Another way,(I'm in a programming class) is to download MinGW for your computer. I don't have the link ready on hand. But regardless, download MinGW and make sure you know which harddrive it downloads into (Commonly in C:\) then when in the Command Prompt, type in:
Exactly(PATH I'm not so sure about) go to the area where your file is located(in the command prompt). type in:
Or just type the first few letter of the file name and hit TAB on the keyboard. The file name should appear and then just hit Enter/Start above the Shift Key.
Your program should start.