Thread: * key in command prompt

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    13

    * key in command prompt

    Hey guys. I was trying to write a Polish Calculator to run from the command line, and it didn't work because everytime I typed in "*" it would recognize it as a list of every program in the same folder. I'm guessing this is a command prompt thing, so I had a couple of questions.

    1: Is there a way to get it to recognize it as '*' and not as that command?

    2: Is there a website or list of all such commands for the command prompt?

    Thanks!

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    You could insert the whole statement in double quotes.
    Devoted my life to programming...

  3. #3
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    ^ Or just escape it.
    Code:
    ./a.out  \*

  4. #4
    Registered User
    Join Date
    Nov 2011
    Posts
    13
    Interesting. The double quotes thing didnt work, What did work was putting a single quote after the *, so it was
    Code:
    expr 2 2 *'
    is this difference because I am running vista?

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    Are you using an IDE to compile and run your program. If so try running the program from the command line. What compiler are you using? And if using an IDE which one?

    Jim

  6. #6
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    The double quotes didn't work because that will put the whole string into the argv[1] (which you probably weren't expecting).
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to do not pop up the command prompt?
    By ZaC in forum C Programming
    Replies: 4
    Last Post: 06-30-2009, 04:58 AM
  2. Command Prompt
    By Trafalgar Law in forum Tech Board
    Replies: 3
    Last Post: 10-09-2008, 06:00 PM
  3. command prompt++
    By l2u in forum Tech Board
    Replies: 13
    Last Post: 04-29-2007, 12:21 AM
  4. Command Prompt here
    By Salem in forum Tech Board
    Replies: 0
    Last Post: 04-11-2005, 11:10 AM
  5. No command prompt please!
    By Lurker in forum Windows Programming
    Replies: 3
    Last Post: 03-07-2003, 04:00 PM