Inputting data as text files. 
Author Message
 Inputting data as text files.

Hello:

I am trying to figure out how to input and read text data files.  Where
should the data files be located?  Do I have to include the entire path name
for the text file input within the program?

Alternately, is there code which allows the command line arguments to be
input while using a Windows-type (non-command line) compiler?

Sorry for being vague, but I am rather inexperienced.

dcw



Mon, 28 Mar 2005 03:39:01 GMT  
 Inputting data as text files.
On Wed, 9 Oct 2002 12:39:01 -0700, "Darren Wilton"

|Hello:
|
|I am trying to figure out how to input and read text data files.  Where
|should the data files be located?  Do I have to include the entire path name
|for the text file input within the program?
|

depends where you have the executable and where you have the files...
there is nothing wrong having a fully qualified path to the file when you open
it. on the other hand it's less flexible.
different operating systems have different schemes when finding files.

|Alternately, is there code which allows the command line arguments to be
|input while using a Windows-type (non-command line) compiler?
|

well again that depends on what compiler you are using. normally afaik you
can always get the commandline. depending on the framework you are using it
looks slightly different.

|Sorry for being vague, but I am rather inexperienced.
|

nothing wrong in asking

however the more detailed you ask the more detailed the answer :)



Mon, 28 Mar 2005 04:43:19 GMT  
 Inputting data as text files.

Quote:

> Hello:

These questions don't apply to the language C itself, but to the environment
provided by your particular implementation (operating system, libraries and
compiler). It would be better to ask in a newsgroup where they are on-topic,
such as one of the newsgroups in the comp.os.ms-windows.programmer
hierarchy.

Quote:
> I am trying to figure out how to input and read text data
> files.  Where should the data files be located?  Do I have
> to include the entire path name for the text file input
> within the program?

If the data files are in the current directory (from the program's point of
view), then you can specify the name without a path. You can also specify a
relative path, eg: "../../data/data.dat" or a full path, eg:
"c:/data/data.dat". The benefit of using a full path is that it doesn't
matter what directory the program is invoked from. The problem is if the
data file is moved to another directory, or if the program is installed onto
a different disk, then you will need to be able to modify the expected
location.

Quote:
> Alternately, is there code which allows the command line
> arguments to be input while using a Windows-type (non-command
> line) compiler?

Yes, you can specify command line arguments in a shortcut to the
application. They are used in the normal way (argc / argv).

--
Simon.



Mon, 28 Mar 2005 10:10:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Data Validation of data inside a text file

2. Invalid input in text file

3. Invalid input in text file

4. Search a input string in a text file

5. Need help with input data from file

6. Input a Text file and SORT

7. Need help with input from text file

8. Progress bar on inputted text file

9. Bad input, from a text file.

10. reading 1 dimensional data from an input file??

11. to overwrite data in a text file

12. Text Data File to 2D Array?

 

 
Powered by phpBB® Forum Software