#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    world
    Posts
    293
    Rep Power
    14

    syntax to open a *.txt file


    hi,
    what is the syntax to open a *.txt file from within the program ?

    actually my output gets saved in a *.txt file,

    i want it to pop-up after i have run my program

    thanks,
  2. #2
  3. Throws Rocks
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio
    Posts
    392
    Rep Power
    14

    more info


    perhaps you could include more info:
    • what language
    • what compiler
    • what system architecture
    • stream oriented or not


    no offense, but i would think after the number of posts that you have, you would be able to post a thread in a much better manner.
    Two things have come out of Berkeley, Unix and LSD.
    It is uncertain which caused the other.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    world
    Posts
    293
    Rep Power
    14
    sorry,
    yah

    Language - Visual C++
    Compiler - Visual C++

    system architecture - none or not known

    Not stream oriented

    actually this post is for a friend.

    thanks,
  6. #4
  7. Throws Rocks
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio
    Posts
    392
    Rep Power
    14
    Originally posted by darcher
    system architecture - none or not known
    rofl @ none or not known.
    if you're running Visual C++, it's obviously x86.

    since it's not stream oriented, i'm guessing he or she might be using functions like fopen, fclose, fprintf, fscanf, fgets, or fputs. any of those look familiar?

    why can't your 'friend' post his or her own problems (or solve them even)? also, why don't you just post up your 'friends' source code? that would provide much more insight to the problem.
    Two things have come out of Berkeley, Unix and LSD.
    It is uncertain which caused the other.
  8. #5
  9. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    If I am understanding your request correctly, before you end your program send a command to the command-interpreter by using the system function. i.e.
    Code:
    #include <process.h>
    int main()
    {
       system( "notepad yourfile.txt" );
       return 1;
    }
    You can find info on this in the msdn.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13
    sorry for going off topic here but where can you get msdn?
  12. #7
  13. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    For the online reference:
    http://msdn.microsoft.com
    But you should have also gotten the help library from the cd bundle that came with the Visual Studio.
    There are 2 cds with about 1 gig of help info.
  14. #8
  15. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Location
    world
    Posts
    293
    Rep Power
    14
    Thanks OnSlaught, that worked,

    now how could i close that notepad file after a few minutes ?

IMN logo majestic logo threadwatch logo seochat tools logo