Click here to Skip to main content
16,008,075 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: funtion over-loading error Pin
Viorel.16-Nov-06 1:16
Viorel.16-Nov-06 1:16 
AnswerRe: funtion over-loading error Pin
Cedric Moonen16-Nov-06 1:19
Cedric Moonen16-Nov-06 1:19 
GeneralRe: funtion over-loading error Pin
odesh16-Nov-06 3:51
odesh16-Nov-06 3:51 
AnswerRe: funtion over-loading error Pin
Nemanja Trifunovic16-Nov-06 2:52
Nemanja Trifunovic16-Nov-06 2:52 
GeneralRe: funtion over-loading error Pin
odesh16-Nov-06 3:51
odesh16-Nov-06 3:51 
AnswerRe: funtion over-loading error Pin
David Crow16-Nov-06 3:13
David Crow16-Nov-06 3:13 
QuestionHow to read data from .txt file Pin
Shah Satish15-Nov-06 23:13
Shah Satish15-Nov-06 23:13 
AnswerRe: How to read data from .txt file Pin
Programm3r15-Nov-06 23:21
Programm3r15-Nov-06 23:21 
Here a code snippet that might help you:

<code>
// Get the contents of the file
 //file handle
 HANDLE hFile;
 //something to contain the number of bytes read
 DWORD dwNumRead;
 //a boolean test variable, to test for success of reads
 BOOL bTest;
 //a buffer… can actually be of any type
 char dwBuffer[256];

 // Opening an existing file for reading:
 hFile = CreateFile("File1.txt", GENERIC_READ, FILE_SHARE_READ,NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
 // To read from the file:
 bTest= ReadFile(hFile, dwBuffer, sizeof(char)*256, &dwNumRead,NULL);
 char seps[]   = "\n\r";
 char *token;
 char *Lines[10];
 for (int i=0;i<10;i++)
 {
	Lines[i] = NULL;
 }
 /* Establish string and get the first token: */
 token = strtok( dwBuffer, seps );
 int x = 0;
 while( token != NULL )
 {
	/* While there are tokens in "string" */
	Lines[x] = token;
	/* Get next token: */
	token = strtok( NULL, seps );
	x++;
 }
</code>


The only programmers that are better than C programmers are those who code in 1's and 0's..... Smile | :)

Smile | :) Programm3r

GeneralRe: How to read data from .txt file Pin
Christian Graus15-Nov-06 23:27
protectorChristian Graus15-Nov-06 23:27 
GeneralRe: How to read data from .txt file Pin
toxcct15-Nov-06 23:28
toxcct15-Nov-06 23:28 
GeneralRe: How to read data from .txt file Pin
Christian Graus15-Nov-06 23:36
protectorChristian Graus15-Nov-06 23:36 
GeneralRe: How to read data from .txt file Pin
toxcct15-Nov-06 23:39
toxcct15-Nov-06 23:39 
GeneralRe: How to read data from .txt file Pin
Programm3r15-Nov-06 23:31
Programm3r15-Nov-06 23:31 
QuestionRe: How to read data from .txt file Pin
David Crow16-Nov-06 2:57
David Crow16-Nov-06 2:57 
GeneralRe: How to read data from .txt file Pin
Shah Satish15-Nov-06 23:33
Shah Satish15-Nov-06 23:33 
AnswerRe: How to read data from .txt file Pin
Christian Graus15-Nov-06 23:25
protectorChristian Graus15-Nov-06 23:25 
AnswerRe: How to read data from .txt file Pin
David Crow16-Nov-06 3:15
David Crow16-Nov-06 3:15 
GeneralRe: How to read data from .txt file Pin
Shah Satish16-Nov-06 4:04
Shah Satish16-Nov-06 4:04 
GeneralRe: How to read data from .txt file Pin
David Crow16-Nov-06 4:06
David Crow16-Nov-06 4:06 
QuestionDeleteFile Function... Pin
Programm3r15-Nov-06 23:13
Programm3r15-Nov-06 23:13 
AnswerRe: DeleteFile Function... Pin
toxcct15-Nov-06 23:25
toxcct15-Nov-06 23:25 
GeneralRe: DeleteFile Function... Pin
Programm3r15-Nov-06 23:35
Programm3r15-Nov-06 23:35 
GeneralRe: DeleteFile Function... Pin
Hamid_RT16-Nov-06 0:32
Hamid_RT16-Nov-06 0:32 
GeneralRe: DeleteFile Function... Pin
Programm3r16-Nov-06 0:43
Programm3r16-Nov-06 0:43 
QuestionCreate XML file from registry ? Pin
Sakthiu15-Nov-06 22:45
Sakthiu15-Nov-06 22:45 

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.