Click here to Skip to main content
16,012,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralBack-propagation Neural Net By Tejpal Singh Chhabra Pin
shaka227-Mar-08 22:54
shaka227-Mar-08 22:54 
GeneralRe: Back-propagation Neural Net By Tejpal Singh Chhabra Pin
Iain Clarke, Warrior Programmer27-Mar-08 23:11
Iain Clarke, Warrior Programmer27-Mar-08 23:11 
GeneralRe: Back-propagation Neural Net By Tejpal Singh Chhabra Pin
ThatsAlok27-Mar-08 23:32
ThatsAlok27-Mar-08 23:32 
GeneralChange IP Header TOS Field [modified] Pin
cedric.bouchet27-Mar-08 22:51
cedric.bouchet27-Mar-08 22:51 
GeneralRe: Change IP Header TOS Field Pin
Mark Salsbery28-Mar-08 6:51
Mark Salsbery28-Mar-08 6:51 
GeneralRe: Change IP Header TOS Field Pin
cedric.bouchet30-Mar-08 21:12
cedric.bouchet30-Mar-08 21:12 
Generalreading a line from the text Pin
Chandrasekharan P27-Mar-08 22:05
Chandrasekharan P27-Mar-08 22:05 
GeneralRe: reading a line from the text [modified] Pin
Iain Clarke, Warrior Programmer27-Mar-08 22:56
Iain Clarke, Warrior Programmer27-Mar-08 22:56 
If you're reading it in C, then you can't store it in a CString (C++).

For MFC, you can use CStdioFile and its member function ReadString.

In C, it's a bit harder - you have no idea about the buffer length for your TCHARs (you are using unicode compatible code, I hope...), so you're going to have to keep the current file pointer, read through the file until you hit the end, or a carriage return, calculate the size, rewind, then read the string.

Or read the whole file into memory, and act on it as a big chunk of ram, which will be similar, but faster.

And now someone will come along and tell you to use
WinReadStringFromFile (...); (Made up name, before you look for it)

Good luck,

Iain.

Iain Clarke appears because CPallini still cares.

modified on Friday, March 28, 2008 5:48 AM

GeneralRe: reading a line from the text Pin
ThatsAlok27-Mar-08 23:35
ThatsAlok27-Mar-08 23:35 
GeneralRe: reading a line from the text Pin
Iain Clarke, Warrior Programmer27-Mar-08 23:50
Iain Clarke, Warrior Programmer27-Mar-08 23:50 
GeneralYou're definitely a cheater! Pin
CPallini28-Mar-08 0:05
mveCPallini28-Mar-08 0:05 
GeneralRe: You're definitely a cheater! Pin
Iain Clarke, Warrior Programmer28-Mar-08 0:20
Iain Clarke, Warrior Programmer28-Mar-08 0:20 
GeneralRe: You're definitely a cheater! Pin
CPallini28-Mar-08 0:25
mveCPallini28-Mar-08 0:25 
GeneralRe: reading a line from the text Pin
ThatsAlok28-Mar-08 0:35
ThatsAlok28-Mar-08 0:35 
GeneralRe: reading a line from the text Pin
Iain Clarke, Warrior Programmer28-Mar-08 0:40
Iain Clarke, Warrior Programmer28-Mar-08 0:40 
GeneralRe: reading a line from the text Pin
ThatsAlok28-Mar-08 3:26
ThatsAlok28-Mar-08 3:26 
GeneralRe: reading a line from the text Pin
David Crow28-Mar-08 3:11
David Crow28-Mar-08 3:11 
General#include "math.h" vs #include <cmath> [modified]</cmath> Pin
rp_suman27-Mar-08 21:47
rp_suman27-Mar-08 21:47 
GeneralRe: #include "math.h" vs #include Pin
ThatsAlok27-Mar-08 21:52
ThatsAlok27-Mar-08 21:52 
GeneralRe: #include "math.h" vs #include Pin
BadKarma27-Mar-08 22:08
BadKarma27-Mar-08 22:08 
GeneralRe: #include "math.h" vs #include Pin
ThatsAlok27-Mar-08 23:31
ThatsAlok27-Mar-08 23:31 
GeneralRe: #include "math.h" vs #include "cmath" Pin
rp_suman27-Mar-08 22:44
rp_suman27-Mar-08 22:44 
GeneralRe: #include "math.h" vs #include "cmath" Pin
ThatsAlok27-Mar-08 23:00
ThatsAlok27-Mar-08 23:00 
GeneralRe: #include "math.h" vs #include Pin
Sgg24528-Mar-08 0:33
Sgg24528-Mar-08 0:33 
Generalswap function of STL container Pin
George_George27-Mar-08 21:23
George_George27-Mar-08 21:23 

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.