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

C / C++ / MFC

 
GeneralDetecting connections... Pin
einst9921-Jun-02 10:30
einst9921-Jun-02 10:30 
GeneralRe: Detecting connections... Pin
Rama Krishna Vavilala1-Jun-02 12:19
Rama Krishna Vavilala1-Jun-02 12:19 
QuestionWhere can I get masm? Pin
1-Jun-02 10:29
suss1-Jun-02 10:29 
AnswerRe: Where can I get masm? Pin
Tim Smith1-Jun-02 10:38
Tim Smith1-Jun-02 10:38 
GeneralRe: Where can I get masm? Pin
1-Jun-02 10:53
suss1-Jun-02 10:53 
AnswerRe: Where can I get masm? Pin
Nish Nishant1-Jun-02 18:14
sitebuilderNish Nishant1-Jun-02 18:14 
AnswerRe: Where can I get masm? Pin
David_LoveCpp17-Mar-10 22:32
David_LoveCpp17-Mar-10 22:32 
Questionwhich way is better? Pin
pnpfriend1-Jun-02 9:24
pnpfriend1-Jun-02 9:24 
i have a structure, call
<br />
struct FileType<br />
{<br />
  char type[_MAX_EXT];<br />
  char size[20];<br />
   <br />
};<br />
<br />

and the text file that looks like

.txt 4140
.tif 4100
.doc 21000
.pdf 3459
.
.
.


so i want to read from the text file and put it into array.
so used vector.

<br />
#include <vector><br />
typedef vector<TypeSize> typeNsize;<br />
<br />
  TypeSize typeNsize;<br />
<br />
  ifstream filelist("TableOfType.txt",ios::in);   //open TableOfType.txt  <br />
  while(!filelist.eof())<br />
  {<br />
    filelist>>typeNsize.filetype>>typeNsize.size;<br />
    <br />
  }<br />
  filelist.close();<br />

my application is dialog base.

and i have following errors
<br />
<br />
SMPprojectDlg.cpp<br />
E:\SMP\SMPprojectDlg.cpp(2161) : error C2143: syntax error : missing ';' before '<'<br />
E:\SMP\SMPprojectDlg.cpp(2161) : error C2143: syntax error : missing ';' before '<'<br />
E:\SMP\SMPprojectDlg.cpp(2163) : error C2065: 'TypeSize' : undeclared identifier<br />
E:\SMP\SMPprojectDlg.cpp(2163) : error C2146: syntax error : missing ';' before identifier 'typeNsize'<br />
E:\SMP\SMPprojectDlg.cpp(2163) : error C2065: 'typeNsize' : undeclared identifier<br />
E:\SMP\SMPprojectDlg.cpp(2168) : error C2228: left of '.filetype' must have class/struct/union type<br />
E:\SMP\SMPprojectDlg.cpp(2168) : error C2228: left of '.size' must have class/struct/union type<br />
Error executing cl.exe.<br />
<br />
SMPproject.exe - 7 error(s), 0 warning(s)<br />


i was thinking to use CStringArray like read the sentence like
<br />
char info[50];<br />
filelist.getline(info,50,'\n');<br />
CString infoline = (const char*)info;<br />
CStringArray array;<br />
array.add(infoline)<br />

if i do so , i have to separate the string into two parts, type and size, again. i dont' want to do that..
do you have any idea better than what i have right now?
AnswerRe: which way is better? Pin
Brian Delahunty1-Jun-02 10:24
Brian Delahunty1-Jun-02 10:24 
GeneralCView border Pin
Joel Holdsworth1-Jun-02 9:27
Joel Holdsworth1-Jun-02 9:27 
GeneralRe: CView border Pin
Neville Franks1-Jun-02 11:37
Neville Franks1-Jun-02 11:37 
GeneralRe: CView border Pin
Paul M Watt1-Jun-02 18:16
mentorPaul M Watt1-Jun-02 18:16 
GeneralAfxGetMain window oddness Pin
Joel Holdsworth1-Jun-02 9:17
Joel Holdsworth1-Jun-02 9:17 
GeneralRe: AfxGetMain window oddness Pin
Neville Franks1-Jun-02 11:44
Neville Franks1-Jun-02 11:44 
GeneralRe: AfxGetMain window oddness Pin
Nish Nishant1-Jun-02 16:20
sitebuilderNish Nishant1-Jun-02 16:20 
GeneralFlame me to a crisp, but... Pin
Domenic Denicola1-Jun-02 8:40
Domenic Denicola1-Jun-02 8:40 
GeneralRe: Flame me to a crisp, but... Pin
Brian Delahunty1-Jun-02 9:28
Brian Delahunty1-Jun-02 9:28 
GeneralProtected Storage Service Pin
David Lau1-Jun-02 8:17
David Lau1-Jun-02 8:17 
Generalspeed up Pin
pnpfriend1-Jun-02 6:48
pnpfriend1-Jun-02 6:48 
GeneralRe: speed up Pin
Joaquín M López Muñoz1-Jun-02 6:56
Joaquín M López Muñoz1-Jun-02 6:56 
GeneralRe: speed up Pin
Brian Delahunty1-Jun-02 7:11
Brian Delahunty1-Jun-02 7:11 
GeneralRe: speed up Pin
pnpfriend1-Jun-02 7:52
pnpfriend1-Jun-02 7:52 
GeneralRe: speed up Pin
Brian Delahunty1-Jun-02 9:33
Brian Delahunty1-Jun-02 9:33 
GeneralRe: speed up Pin
pnpfriend1-Jun-02 9:47
pnpfriend1-Jun-02 9:47 
GeneralRe: speed up Pin
Brian Delahunty1-Jun-02 10:05
Brian Delahunty1-Jun-02 10:05 

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.