Help Needed

This is a discussion on Help Needed within the C Programming forums, part of the General Programming Boards category; ok, I am a newbie to c & I want to make a basic program in ms-dos. But I can ...

  1. #1

    Question Help Needed

    ok, I am a newbie to c & I want to make a basic program in ms-dos. But I can never seem to execute commands properly, check this out:

    <!-- Crappy Code Begin --!>
    #include <stdio.h>

    <!-- Crappy Code End --!>

    Now when I compile & run this thing it never works, all it is supposed to do is the 'dir' command in ms-dos but all I get is a blank black screen.

    What am I doing wrong here people?

  2. #2
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Works fine on my machine (Windows NT/VC++ 6.0):
    #include <stdio.h>
    #include <stdlib.h>
    int main()
      return 0;

  3. #3
    Join Date
    Aug 2001
    Groningen (NL)
    Also works fine with me (Windows 98/GCC 3.03.

    What OS and compiler are you using?

  4. #4

    I am using

    I am using Windows 98 with the Miracle C compiler, But that code worked fine, thanx. Must have just been the return 0;

  5. #5
    ahh crap, it don't work but I thought it did

    I was typing dir.exe (the name of the program) to execute it & it just brang up a list of directories, but when I renamed it & executed it again I found out that it didn't actually work.

    Anybody know what the problem is?

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    > Miracle C compiler
    This isn't an ANSI-C compiler - you're going to miss out on some things.

  7. #7


    ok thanx, it was just the compiler . I can now execute commands like dir, time & date in ms-dos.

    But how would I go about doing commands such as cd c:\?
    I tried system("cd c:\"); without any luck.

    This is the last question I will ask.

    Many Thanx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. free needed or not?
    By quantt in forum Linux Programming
    Replies: 3
    Last Post: 06-25-2009, 10:32 AM
  2. C Programmers needed for Direct Hire positions
    By canefan in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 09-24-2008, 12:55 PM
  3. lock needed in this scenario?
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-25-2008, 08:22 AM
  4. Releasing a program - what is needed? A few Q's
    By ulillillia in forum Tech Board
    Replies: 9
    Last Post: 04-28-2007, 01:18 AM
  5. C++ help needed
    By Enkindu in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-01-2004, 12:24 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21