Thread: help on console programs needed

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    4

    help on console programs needed

    how do console programs work? are they basically dos programs that get interpretted by window's command prompt? also, if that's so, how can you make it to where it uses cmd.exe and not command.com? (i'm assuming it uses command.com because i've noticed that in calls to system("c:\somefolder\somefile.exe") you had to truncate it like system("c:\somefo~1\somefi~1.exe") to follow the 8.3 rule that the 16bit command.com requires). i really don't want to have to think of a way to convert standard directory definitions to truncated for input and output. any clarification of any of this would be greatly appreciated.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    No. Console programs are Windows programs 'dressed up' to look like old-style DOS programs. But they are in fact 32-bit executables all the same. The filename mess is just a cruel MS imposition. There is a workaround though. If you include <windows.h> you can call the function GetCommandLine(). Voila - unadultered filenames...whee! Unfortunately, it returns a single string (char*, that is) that must be parsed to get the individual filenames. A small price to pay, though, and well worth the effort...
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    4
    great thanks a lot.
    i appreciate the help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Starting programs
    By Molokai in forum C Programming
    Replies: 1
    Last Post: 04-16-2009, 10:10 AM
  2. Shift-JIS enabled Console on Windows 2000
    By Lynux-Penguin in forum Tech Board
    Replies: 0
    Last Post: 08-21-2003, 05:36 PM
  3. Linux console window questions
    By GaPe in forum Linux Programming
    Replies: 1
    Last Post: 12-28-2002, 12:18 PM
  4. Sprites In Console
    By c++_n00b in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 04-13-2002, 07:02 AM
  5. win32 apps compiled with GCC start console window!
    By Citrus538 in forum Windows Programming
    Replies: 5
    Last Post: 02-18-2002, 10:35 PM