Thread: open a file through c++

  1. #1
    Registered User
    Join Date
    May 2003

    Question open a file through c++

    I am an AP student in high school and am currently working on a large program. I was wondering if it is possible to have my program open a file that is usually opened through the comand prompt.
    please e-mail me at

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Ontario, Canada
    Try reading the FAQ.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User major_small's Avatar
    Join Date
    May 2003
    which class? comp sci A or comp sci AB... or something else...
    Join is in our Unofficial Cprog IRC channel
    Channel: #Tech

    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  4. #4
    Registered User
    Join Date
    Feb 2003
    what type of "file" are you trying to open?

  5. #5
    Wen Resu
    Join Date
    May 2003
    Hint<if your in windows>. try the windows API.... full of usefull features

  6. #6
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    If your program has permission to read the file, then there should be no problem opening it through fstream.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  7. #7
    Wen Resu
    Join Date
    May 2003
    why not just use
    #include <cstdlib>

    system("Char array that equals the command you would write to open this file from the commandline" )

    IE: System("C:\Something.exe");

    Ok it may be C but it should work

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 07:51 PM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM