Thread: Opening Files from c++

  1. #1
    Registered User snowy101's Avatar
    Join Date
    May 2002
    Posts
    22

    Question Opening Files from c++

    if it is possible to open a file from c++ how would i do it? basicly all i want to do is open up an image file in paint. (preferably jpg) if you dont know how but know any sites that might help me out please post them.
    Simple Programming

    :::: Error Message != A Smile ::::

  2. #2
    Unregistered
    Guest
    #include<stdlib.h>
    int main()
    {
    system("c:\\progra~1\\access~1\\mspaint.exe c:\\windows\\file.bmp");
    return 0;
    }


    Don't forget the use the MSDOS format for the path of the file.

  3. #3
    Registered User
    Join Date
    Jun 2002
    Posts
    79
    #include<stdlib.h>
    int main()
    {
    system("c:\\progra~1\\access~1\\mspaint.exe c:\\windows\\file.bmp");
    return 0;
    }


    Don't forget to use the MSDOS format for the path of the file.
    Last edited by sundeeptuteja; 06-26-2002 at 10:17 AM.

  4. #4
    Unregistered
    Guest
    this is snowy101 just forgot to log in is there a way to go threw folders with spaces like My Documents instead of opening the file in windows folder? how would i do that because i dunno how to do with it spaces doesn't work with spaces

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > is there a way to go threw folders with spaces like My Documents
    If you have a reasonably up to date compiler, which is long filename aware, then yes

    If you're still using fossil-dos-C from long ago, then you're out of luck.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Opening ASCII files in C?
    By Mavix in forum C Programming
    Replies: 6
    Last Post: 04-25-2007, 02:23 PM
  2. Need help opening a series of files
    By ramparts in forum C Programming
    Replies: 9
    Last Post: 11-14-2006, 05:49 PM
  3. Opening files with UNICODE file names
    By decohk in forum Linux Programming
    Replies: 2
    Last Post: 11-09-2006, 05:25 AM
  4. opening files
    By angelic79 in forum C Programming
    Replies: 3
    Last Post: 10-19-2004, 06:52 AM
  5. Opening files - Giving options?
    By wwwGazUKcom in forum C++ Programming
    Replies: 3
    Last Post: 09-18-2001, 07:06 AM