how to get files and store them...
hello there...uhmmm, im having problems with getting the file and storing them...like for example, you ask the user to input a file then that file will be stored...how do you get that file, and where do you store them?? thanks
jaepi
Practically a Master Poster
647 posts since Jul 2006
Reputation Points: 32
Solved Threads: 4
I think you may have misunderstood the assignment. Are you supposed to ask for the information to be put into the file? The name of the file? or both?
Is this a C or C++ program? What compiler and operating system?
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
uhmmm ask for the file name then store the file itself...like for example
.....................................................
enter file name of file you would like to store: dragon.jpg
........................................................
dragon.jpg then will be stored
, but idk how to get the file and store it..
yes, it is c++ in linux...help pls...
jaepi
Practically a Master Poster
647 posts since Jul 2006
Reputation Points: 32
Solved Threads: 4
>>but idk how to get the file and store it
don't know -- you will probably have to ask your teacher. Saving the file is easy but depends on whether you are writing a C or C++ program, which you failed to answer. I can only presume your program already has the data for the find in memory, or its in another file somewhere. But you need to get clarification from the instructions (please post them) or from your teacher.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>which can be used by including. #include
Please don't encourage the use of pre-standard headers. We're getting to the point where compilers will refuse to build code that uses them.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Theres absolutley nothing wrong with using the fstream library for handling Input/Output streaming.
Are you talking about fstream or fstream.h?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
>Theres absolutley nothing wrong with using the fstream library for
>handling Input/Output streaming.
No, there's not. However, when you say to use fstream.h instead of fstream, you're not using the fstream library. You're using some non-standard library with inconsistent semantics that happens to be called fstream.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
naure i love your animated avatar
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
How do you get an animated avatar?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
>be a sponsor
Or a moderator. One costs you money, the other costs you sanity.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
I think I can live without it then. :D I'm trying to ween myself off the pc.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
Are you back at work narue?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
>i was unaware there was a difference.
Now you are. To use the fstream library, you include , not .
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401