Why won't my compiler let me open files?

This is a discussion on Why won't my compiler let me open files? within the C Programming forums, part of the General Programming Boards category; Visual Studio .NET 2005, possibly the professional version. I went to the C tutorial where it teaches you how to ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    100

    Question Why won't my compiler let me open files?

    Visual Studio .NET 2005, possibly the professional version.

    I went to the C tutorial where it teaches you how to accept command line arguments, and I copied and pasted that code into my compiler at school to make sure it works (I'm trying to debug one of my university assignments, and finding the problem has been a little annoying. I was trying to make sure the compiler was acting normal, or if I need to change its settings.)

    Anyway...................
    When I pasted that code, it would successfully compile. But when I tried to run/debug the thing, it wouldn't let me put in any command line arguments. I have everything set on a Win32 console application, and this is not the first time I've had this kind of trouble come up.

    Also the command line window that I was trying to use the program with closed at the speed of light (this of course, was activated by clicking on the debug button). I tried putting in a getchar() at the end just to get the window to stay open long enough for me to examine it, but that didn't work either.

    So my question is...What on Earth is going on?

    Thanks ahead of time to any of you that tell me.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    So really, it's not "why won't my compiler let me open files", but instead it's "how do I input command line arguments to my program when I run it through my IDE".

    See how much better it is when you actually say what it is you need?

    Now since you've supposedly got the professional version installed, press F1, pull up your MSDN, and type in 'command line arguments'.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    It might be easier if you ran your program from the command line. Then you could pass any arguments you needed, as well as examine the output.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Also, if you don't run the program as Debug but instead as Run, VC++ will keep the console open for you.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Too many files open?
    By homer_3 in forum C++ Programming
    Replies: 2
    Last Post: 11-11-2008, 09:17 PM
  2. Open files inside directory (UNIX platform)
    By swagatob in forum C Programming
    Replies: 15
    Last Post: 10-25-2004, 12:58 AM
  3. how to open exe files
    By InvariantLoop in forum C++ Programming
    Replies: 4
    Last Post: 05-06-2004, 07:26 PM
  4. Copy Large (possible Open) files kill processor
    By Robert Austin in forum C++ Programming
    Replies: 0
    Last Post: 01-30-2003, 03:43 AM
  5. Dos commands hehe
    By Carp in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 01-17-2003, 01:51 PM

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