Click here to Skip to main content
15,914,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: disable enter and escape Pin
Chris Losinger12-Aug-02 5:45
professionalChris Losinger12-Aug-02 5:45 
GeneralRe: disable enter and escape Pin
Zizilamoroso12-Aug-02 6:20
Zizilamoroso12-Aug-02 6:20 
GeneralRe: disable enter and escape Pin
Chris Losinger12-Aug-02 6:37
professionalChris Losinger12-Aug-02 6:37 
GeneralRe: disable enter and escape Pin
lucy12-Aug-02 9:23
lucy12-Aug-02 9:23 
GeneralRe: disable enter and escape Pin
Zizilamoroso13-Aug-02 6:25
Zizilamoroso13-Aug-02 6:25 
GeneralHelp select custom line in virtual CListView Pin
Stas12-Aug-02 4:28
Stas12-Aug-02 4:28 
Generaltrouble with ifstream - kinda wierd Pin
12-Aug-02 4:18
suss12-Aug-02 4:18 
GeneralRe: trouble with ifstream - kinda wierd Pin
Brian Delahunty12-Aug-02 5:45
Brian Delahunty12-Aug-02 5:45 
here you go.. this should work.. I think...
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;

void main()
{
	
	vector<int> values;
	ifstream file("demo.txt");
	while(!file.eof())
	{
		int nValue = 0;
		file>>nValue;
		values.push_back(nValue);
		cout << nValue << endl; // Just to show it's working
	}
	file.close();
	
}


well.. I'm assuming it will. Oh.. and sometimes have a new line at teh end of a file will give you an arbitary value.. SO don't put in a new line at eh end.



"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]

"It's The Soapbox; topics are optional" Shog 9
Generalsymbols in list box string Pin
kramery12-Aug-02 4:10
susskramery12-Aug-02 4:10 
GeneralRe: symbols in list box string Pin
pépé12-Aug-02 21:53
pépé12-Aug-02 21:53 
QuestionHow can I change the background color on a date/time picker? Pin
DanYELL12-Aug-02 4:03
DanYELL12-Aug-02 4:03 
AnswerRe: How can I change the background color on a date/time picker? Pin
Ranjan Banerji12-Aug-02 6:26
Ranjan Banerji12-Aug-02 6:26 
GeneralGetting the Exact Time (in ms) Pin
LittleYellowBird12-Aug-02 3:18
LittleYellowBird12-Aug-02 3:18 
GeneralRe: Getting the Exact Time (in ms) Pin
Tomasz Sowinski12-Aug-02 3:30
Tomasz Sowinski12-Aug-02 3:30 
GeneralCustom control based on dialog Pin
Wim Jans12-Aug-02 3:12
Wim Jans12-Aug-02 3:12 
GeneralRe: Custom control based on dialog Pin
Tomasz Sowinski12-Aug-02 3:15
Tomasz Sowinski12-Aug-02 3:15 
GeneralRe: Custom control based on dialog Pin
Wim Jans12-Aug-02 5:35
Wim Jans12-Aug-02 5:35 
Generalproblem with propertysheetex Pin
toon12-Aug-02 2:58
toon12-Aug-02 2:58 
GeneralAccess Database mysteries in VC++... Pin
Anonymous12-Aug-02 2:57
Anonymous12-Aug-02 2:57 
GeneralRe: Access Database mysteries in VC++... Pin
Stefan Pedersen12-Aug-02 3:21
Stefan Pedersen12-Aug-02 3:21 
GeneralRe: Access Database mysteries in VC++... Pin
Anonymous12-Aug-02 3:23
Anonymous12-Aug-02 3:23 
GeneralRe: Access Database mysteries in VC++... Pin
pépé12-Aug-02 21:57
pépé12-Aug-02 21:57 
GeneralReBars (urgent) Pin
Space Ace12-Aug-02 2:55
Space Ace12-Aug-02 2:55 
GeneralRe: ReBars (urgent) Pin
Tomasz Sowinski12-Aug-02 3:02
Tomasz Sowinski12-Aug-02 3:02 
GeneralRe: ReBars (urgent) Pin
Shog912-Aug-02 3:07
sitebuilderShog912-Aug-02 3:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.