Click here to Skip to main content
15,890,123 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: When to draw the focus rectangle Pin
Michael Dunn27-Feb-05 7:04
sitebuilderMichael Dunn27-Feb-05 7:04 
Generalrandom number between.... Pin
Raylan26-Feb-05 16:20
Raylan26-Feb-05 16:20 
GeneralRe: random number between.... Pin
Ravi Bhavnani26-Feb-05 16:28
professionalRavi Bhavnani26-Feb-05 16:28 
GeneralRe: random number between.... Pin
Sheng Jiang 蒋晟27-Feb-05 9:39
Sheng Jiang 蒋晟27-Feb-05 9:39 
Generalcolor values for palettes Pin
nm_11426-Feb-05 14:10
nm_11426-Feb-05 14:10 
Generalint, read from text file Pin
jonavon blakly26-Feb-05 14:02
jonavon blakly26-Feb-05 14:02 
GeneralRe: int, read from text file Pin
Ravi Bhavnani26-Feb-05 14:11
professionalRavi Bhavnani26-Feb-05 14:11 
GeneralRe: int, read from text file Pin
uus9926-Feb-05 15:37
uus9926-Feb-05 15:37 
Try this,

//File reading----<br />
	CFileException ex;	//catch exceptions<br />
	CFile myfile;<br />
<br />
	//Open file<br />
	myfile.Open("c:/b.txt", CFile::modeRead, &ex);<br />
<br />
	//Get length<br />
	int z=myfile.GetLength();<br />
	//create temp buffer with all data including line breaks<br />
	char* data=new char[z];<br />
	//read data<br />
	myfile.Read(data,z);<br />
<br />
	//Extract only data, remove line breaks<br />
	int* value=new int[z/3];<br />
	for(int i=0;i<z;i=i+3)<br />
		value[i/3]=atol(&data[i]); //convert char to integer<br />
		<br />
	myfile.Close();

GeneralRe: int, read from text file Pin
jonavon blakly27-Feb-05 5:40
jonavon blakly27-Feb-05 5:40 
GeneralRe: int, read from text file Pin
uus9927-Feb-05 13:12
uus9927-Feb-05 13:12 
GeneralRe: int, read from text file Pin
eli1502197927-Feb-05 4:16
eli1502197927-Feb-05 4:16 
GeneralRe: int, read from text file Pin
jonavon blakly27-Feb-05 5:28
jonavon blakly27-Feb-05 5:28 
GeneralRe: int, read from text file (Try this 1) Pin
Alton Williams27-Feb-05 23:39
Alton Williams27-Feb-05 23:39 
Generalcode doesn't work when compiled in debug mode Pin
lino_i26-Feb-05 12:51
lino_i26-Feb-05 12:51 
GeneralRe: code doesn't work when compiled in debug mode Pin
Rob Manderson26-Feb-05 13:21
protectorRob Manderson26-Feb-05 13:21 
GeneralRe: code doesn't work when compiled in debug mode Pin
lino_i26-Feb-05 14:18
lino_i26-Feb-05 14:18 
GeneralRe: code doesn't work when compiled in debug mode Pin
Jibesh27-Feb-05 4:51
professionalJibesh27-Feb-05 4:51 
GeneralRe: code doesn't work when compiled in debug mode Pin
lino_i27-Feb-05 5:38
lino_i27-Feb-05 5:38 
Generalvoid* to Address Conversion Pin
Daklan26-Feb-05 12:22
Daklan26-Feb-05 12:22 
GeneralRe: void* to Address Conversion Pin
Michael Dunn26-Feb-05 12:37
sitebuilderMichael Dunn26-Feb-05 12:37 
GeneralRe: void* to Address Conversion Pin
Daklan26-Feb-05 12:48
Daklan26-Feb-05 12:48 
Generalc++ basic class Pin
bigbadnewill26-Feb-05 11:44
bigbadnewill26-Feb-05 11:44 
GeneralRe: c++ basic class Pin
Daklan26-Feb-05 12:34
Daklan26-Feb-05 12:34 
GeneralRe: c++ basic class Pin
Anonymous27-Feb-05 10:20
Anonymous27-Feb-05 10:20 
GeneralChanging colours of a combo box Pin
Alton Williams26-Feb-05 10:08
Alton Williams26-Feb-05 10:08 

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.