C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 7th, 2002, 07:11 AM
darcher's Avatar
darcher darcher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: world
Posts: 290 darcher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 55 m 15 sec
Reputation Power: 8
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,

Reply With Quote
  #2  
Old July 7th, 2002, 02:25 PM
GNUbie's Avatar
GNUbie GNUbie is offline
Throws Rocks
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: Cincinnati, Ohio
Posts: 392 GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 7 sec
Reputation Power: 8
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.

Reply With Quote
  #3  
Old July 7th, 2002, 08:55 PM
darcher's Avatar
darcher darcher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: world
Posts: 290 darcher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 55 m 15 sec
Reputation Power: 8
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,

Reply With Quote
  #4  
Old July 7th, 2002, 11:39 PM
GNUbie's Avatar
GNUbie GNUbie is offline
Throws Rocks
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: Cincinnati, Ohio
Posts: 392 GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level)GNUbie User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 6 h 31 m 7 sec
Reputation Power: 8
Quote:
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.

Reply With Quote
  #5  
Old July 8th, 2002, 07:43 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
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.

Reply With Quote
  #6  
Old July 8th, 2002, 03:53 PM
Optix Optix is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 36 Optix User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
sorry for going off topic here but where can you get msdn?

Reply With Quote
  #7  
Old July 8th, 2002, 04:04 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
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.

Reply With Quote
  #8  
Old July 9th, 2002, 07:36 PM
darcher's Avatar
darcher darcher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: world
Posts: 290 darcher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 55 m 15 sec
Reputation Power: 8
Thanks OnSlaught, that worked,

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > syntax to open a *.txt file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway