Solved

Getting a set of numbers from a file to cin >>

Posted on 2004-08-30
3
209 Views
Last Modified: 2010-04-01
Hi. I've just started C++ recently and i want to know how to get the data from a file into the program to store it as a char.
I can open the file and make it show the contents in dos when running my console, however, i want to be able to use this in a cin >>. I have tried to place "cin >>" after the data is inputted, but this doesn't work.

Any help
?
Thanks
0
Comment
Question by:warnesey
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
mrwad99 earned 50 total points
ID: 11933555
If you spend 10 minutes reading http://www.cs.hmc.edu/~geoff/classes/hmc.cs070.200401/notes/io.html you will be able to answer your own question as well as many more about file I/O that you may have...

0
 

Author Comment

by:warnesey
ID: 11936323
Hey. Thanks a bunch. Really helped and now i gottit working :)
Cheers
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 11939647
Glad the link helped.

If there is nothing else that can be helped with then you need  to close this question to prevent annoying the moderators who have to clean up ungraded questions and possible negative feedback.

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question