Thread: using cammand line

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    using cammand line

    I'm not sure what it is called, but I want to make a c++ app that uses comand line stuff.

    Like from the program I can put a command line prompt thing and it will do it.

    That is a horible explanation I know, but I just need to be ponited in the right direction.

  2. #2
    Linker.exe64
    Join Date
    Mar 2005
    Location
    Croatia,Pozega
    Posts
    37
    You have tutorial on cmd line arguments here : http://www.cprogramming.com/tutorial/lesson14.html .
    Code:
     
         .J?+.                             ?`+.
       .+1P .++.                         ,+` 4++.
      .+zq\ .:.?i                      .!`?  .yz+.
      ?zdd ..:.^`J.                   ,!..?...Kyz+	
     .+dXM ..!p^.N.+                 ,,^.a..`.#XO+.
     .zwWM ^`.Mc`JMhJ.             .:JF`JM..^.#WOz`
      jwpMr`..NF.JMMM,!           .JMMF.dJ..`JNWrc
       0Wgb `!B:.MMMMM,:         ,.MMMF.j$.` NHSZ`
        TWMp`.+;`MMMMMM.:       ;.MMMMM.;+``JHW=	
          7Mh,``JMMMM"`          .TMMMMb``.H#"`
    

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    hrmm umm let me re explain.

    Oh this is hard to explain, like the windows comand promt, but in my own app.

  4. #4
    Linker.exe64
    Join Date
    Mar 2005
    Location
    Croatia,Pozega
    Posts
    37
    You think on, for example, you have Application window, and you want your own command prompt in it?
    Code:
     
         .J?+.                             ?`+.
       .+1P .++.                         ,+` 4++.
      .+zq\ .:.?i                      .!`?  .yz+.
      ?zdd ..:.^`J.                   ,!..?...Kyz+	
     .+dXM ..!p^.N.+                 ,,^.a..`.#XO+.
     .zwWM ^`.Mc`JMhJ.             .:JF`JM..^.#WOz`
      jwpMr`..NF.JMMM,!           .JMMF.dJ..`JNWrc
       0Wgb `!B:.MMMMM,:         ,.MMMF.j$.` NHSZ`
        TWMp`.+;`MMMMMM.:       ;.MMMMM.;+``JHW=	
          7Mh,``JMMMM"`          .TMMMMb``.H#"`
    

  5. #5
    Linker.exe64
    Join Date
    Mar 2005
    Location
    Croatia,Pozega
    Posts
    37
    Something like this?
    -> See attachment.

    it is from atomic tanks -> http://atanks.sourceforge.net/
    Download source code and find the console.
    Code:
     
         .J?+.                             ?`+.
       .+1P .++.                         ,+` 4++.
      .+zq\ .:.?i                      .!`?  .yz+.
      ?zdd ..:.^`J.                   ,!..?...Kyz+	
     .+dXM ..!p^.N.+                 ,,^.a..`.#XO+.
     .zwWM ^`.Mc`JMhJ.             .:JF`JM..^.#WOz`
      jwpMr`..NF.JMMM,!           .JMMF.dJ..`JNWrc
       0Wgb `!B:.MMMMM,:         ,.MMMF.j$.` NHSZ`
        TWMp`.+;`MMMMMM.:       ;.MMMMM.;+``JHW=	
          7Mh,``JMMMM"`          .TMMMMb``.H#"`
    

  6. #6
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    alright I think somtin like that, somthing were you type in:

    createexe file exe -o

    and than that for say creates an exe from file with the name exe (just somtin random I made up)

  7. #7
    Banned
    Join Date
    Jun 2005
    Posts
    594
    you are talking about command line arguements,
    which is what "81N4RY_DR460N" had posted in his
    first message.


    it would let you get commands from the command line


    such as :


    createtxt.exe -filename "file.txt"


    Code:
    #include <iostream>
    
    using namespace std;
    
    int main ( int argc, char *argv[] )
    {
         cout << argv[0] << endl << endl;
         cout << argv[1] << endl << endl;
         cout << argv[2] << endl << endl;
         cin.get();
         return 0;
    }

  8. #8
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    ok ok I think i see now. I was just thinking somthing different, thanks.

  9. #9
    Linker.exe64
    Join Date
    Mar 2005
    Location
    Croatia,Pozega
    Posts
    37
    You have plenty of tutorials about this at http://www.google.com/search?num=30&...Tra%C5%BEi&lr=
    Code:
     
         .J?+.                             ?`+.
       .+1P .++.                         ,+` 4++.
      .+zq\ .:.?i                      .!`?  .yz+.
      ?zdd ..:.^`J.                   ,!..?...Kyz+	
     .+dXM ..!p^.N.+                 ,,^.a..`.#XO+.
     .zwWM ^`.Mc`JMhJ.             .:JF`JM..^.#WOz`
      jwpMr`..NF.JMMM,!           .JMMF.dJ..`JNWrc
       0Wgb `!B:.MMMMM,:         ,.MMMF.j$.` NHSZ`
        TWMp`.+;`MMMMMM.:       ;.MMMMM.;+``JHW=	
          7Mh,``JMMMM"`          .TMMMMb``.H#"`
    

Popular pages Recent additions subscribe to a feed