Click here to Skip to main content
16,007,760 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Nevermind, figured it out... Pin
Bram van Kampen17-Feb-08 4:52
Bram van Kampen17-Feb-08 4:52 
GeneralRe: noob needs some help with C++ programming class Pin
Hamid_RT18-Feb-08 7:32
Hamid_RT18-Feb-08 7:32 
GeneralMFC - ADO - Windows Vista Pin
Demian Panello16-Feb-08 10:09
Demian Panello16-Feb-08 10:09 
QuestionNeed some solutions! Pin
Johan1316-Feb-08 8:04
Johan1316-Feb-08 8:04 
GeneralRe: Need some solutions! Pin
Hamid_RT18-Feb-08 7:33
Hamid_RT18-Feb-08 7:33 
QuestionReading a file into an array Pin
jonsey2984716-Feb-08 4:51
jonsey2984716-Feb-08 4:51 
GeneralRe: Reading a file into an array Pin
CPallini16-Feb-08 6:54
mveCPallini16-Feb-08 6:54 
GeneralRe: Reading a file into an array Pin
jonsey2984716-Feb-08 8:24
jonsey2984716-Feb-08 8:24 
The array declaration is:

struct DTC{<br />
	char	*Code;<br />
	char 	*Description;<br />
	char	*Defined;<br />
}DTCodes[0x100];<br />
<br />


The code is:
for(i = 0; i < 100; i++)<br />
    {<br />
        k = 0;<br />
        do{<br />
        ReadFile(hDiskFile, tcInputData, 1, &dwBytesRead, NULL);<br />
        if(dwBytesRead == 0)<br />
            break;<br />
        k = strcmp(tcInputData, ",");<br />
        if(k == 1)<br />
            strcat(tcCode, tcInputData);<br />
        }while(k != 0);<br />
        strcat(tcCode, "\0");<br />
        DTCodes[i].Code = tcCode;<br />
        ZeroMemory(tcCode, 0x06);<br />
        do{<br />
        ReadFile(hDiskFile, tcInputData, 1, &dwBytesRead, NULL);<br />
        if(dwBytesRead == 0)<br />
            break;<br />
        k = strcmp(tcInputData, ",");<br />
        if(k == 1);<br />
            strcat(tcDescription, tcInputData);<br />
        }while(k != 0);<br />
        strcat(tcDescription, "\0");<br />
        DTCodes[i].Description = tcDescription;<br />
        ZeroMemory(tcDescription, 0xff);<br />
        tcDescription = "";<br />
        do{<br />
        ReadFile(hDiskFile, tcInputData, 1, &dwBytesRead, NULL);<br />
        if(dwBytesRead == 0)<br />
            break;<br />
        k = strcmp(tcInputData, "\n");<br />
        if(k == 1)<br />
            strcat(tcDefined, tcInputData);<br />
        }while(k != 0);<br />
        strcat(tcDefined, "\0");<br />
        DTCodes[i].Defined = tcDefined;<br />
        ZeroMemory(tcDefined, 0xff);<br />
        tcDefined = "";<br />
    }<br />


What would you recommend instead of strcmp?
GeneralRe: Reading a file into an array Pin
CPallini16-Feb-08 10:01
mveCPallini16-Feb-08 10:01 
GeneralRe: Reading a file into an array Pin
jonsey2984716-Feb-08 15:25
jonsey2984716-Feb-08 15:25 
GeneralRe: Reading a file into an array Pin
CPallini16-Feb-08 22:35
mveCPallini16-Feb-08 22:35 
GeneralRe: Reading a file into an array Pin
jonsey2984717-Feb-08 10:18
jonsey2984717-Feb-08 10:18 
GeneralRe: Reading a file into an array Pin
CPallini17-Feb-08 21:53
mveCPallini17-Feb-08 21:53 
GeneralRe: Reading a file into an array Pin
Rajkumar R16-Feb-08 23:47
Rajkumar R16-Feb-08 23:47 
GeneralRe: Reading a file into an array Pin
jonsey2984717-Feb-08 10:31
jonsey2984717-Feb-08 10:31 
GeneralRe: Reading a file into an array Pin
Rajkumar R17-Feb-08 18:22
Rajkumar R17-Feb-08 18:22 
GeneralRe: Reading a file into an array Pin
jonsey2984718-Feb-08 11:34
jonsey2984718-Feb-08 11:34 
GeneralRe: Reading a file into an array Pin
jonsey2984718-Feb-08 11:36
jonsey2984718-Feb-08 11:36 
QuestionEmbed a CToolBar within a CDialogBar Pin
jeffb4216-Feb-08 4:45
jeffb4216-Feb-08 4:45 
Questionfunctions with 2d array argument Pin
Adnan Merter16-Feb-08 4:18
Adnan Merter16-Feb-08 4:18 
QuestionRe: functions with 2d array argument Pin
CPallini16-Feb-08 4:39
mveCPallini16-Feb-08 4:39 
GeneralRe: functions with 2d array argument Pin
Adnan Merter16-Feb-08 5:24
Adnan Merter16-Feb-08 5:24 
GeneralRe: functions with 2d array argument Pin
CPallini16-Feb-08 6:46
mveCPallini16-Feb-08 6:46 
Generalsimulate ctrl+alt+delete keys in windows Pin
Abdul_khaliq_16-Feb-08 2:27
Abdul_khaliq_16-Feb-08 2:27 
GeneralRe: simulate ctrl+alt+delete keys in windows Pin
Baltoro17-Feb-08 10:13
Baltoro17-Feb-08 10:13 

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.