Click here to Skip to main content
15,909,953 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionresponseBirstring? Pin
CPallini27-Nov-06 3:17
mveCPallini27-Nov-06 3:17 
AnswerRe: responseBirstring? Pin
Programm3r27-Nov-06 3:34
Programm3r27-Nov-06 3:34 
AnswerSorry but... Pin
CPallini27-Nov-06 22:12
mveCPallini27-Nov-06 22:12 
AnswerRe: strcpy | strcat -> Errors Pin
kakan27-Nov-06 3:32
professionalkakan27-Nov-06 3:32 
GeneralRe: strcpy | strcat -> Errors Pin
Programm3r27-Nov-06 3:35
Programm3r27-Nov-06 3:35 
GeneralRe: strcpy | strcat -> Errors Pin
kakan27-Nov-06 3:43
professionalkakan27-Nov-06 3:43 
GeneralRe: strcpy | strcat -> Errors Pin
Programm3r27-Nov-06 3:47
Programm3r27-Nov-06 3:47 
GeneralRe: strcpy | strcat -> Errors Pin
kakan27-Nov-06 3:57
professionalkakan27-Nov-06 3:57 
This works for me, I just tested it.

char string[103];
struct{
    char fileStr[100];
}gList[100];


// Init gList[0-6]
strcpy(gList[0].fileStr, "FileAtIndex0");
strcpy(gList[1].fileStr, "FileAtIndex1");
strcpy(gList[2].fileStr, "FileAtIndex2");
strcpy(gList[3].fileStr, "FileAtIndex3");
strcpy(gList[4].fileStr, "FileAtIndex4");
strcpy(gList[5].fileStr, "FileAtIndex5");
strcpy(gList[6].fileStr, "FileAtIndex6");


for (int i = 0; i < 5; i++) {
    // gList fileStr contains an array of file names
    strcpy((char*)string,(char*)gList[i].fileStr);
    strcat((char*)string," OK"); // Unhandled Exception ...
}


Are you sure your x doesn't get oout of bounds (is less than 100) ?
(Your debugger will tell you... Smile | :) )





Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

AnswerRe: strcpy | strcat -&gt; Errors Pin
benjymous27-Nov-06 4:10
benjymous27-Nov-06 4:10 
AnswerRe: strcpy | strcat -&gt; Errors Pin
David Crow27-Nov-06 4:11
David Crow27-Nov-06 4:11 
AnswerRe: strcpy | strcat -&gt; Errors Pin
Programm3r27-Nov-06 4:17
Programm3r27-Nov-06 4:17 
GeneralRe: strcpy | strcat -&gt; Errors Pin
benjymous27-Nov-06 4:25
benjymous27-Nov-06 4:25 
GeneralRe: strcpy | strcat -&gt; Errors Pin
kakan27-Nov-06 4:29
professionalkakan27-Nov-06 4:29 
QuestionChanging Menu Item's Font OR Bold Menu Items Pin
Andy Rama27-Nov-06 3:02
Andy Rama27-Nov-06 3:02 
AnswerRe: Changing Menu Item's Font OR Bold Menu Items Pin
Ing.Raiz8227-Nov-06 22:04
Ing.Raiz8227-Nov-06 22:04 
GeneralRe: Changing Menu Item's Font OR Bold Menu Items Pin
Andy Rama27-Nov-06 22:21
Andy Rama27-Nov-06 22:21 
QuestionProblem with CPropertySheet class Pin
spielehelfer27-Nov-06 2:27
spielehelfer27-Nov-06 2:27 
QuestionCImageList - Mask Pin
Ajay L D27-Nov-06 2:06
Ajay L D27-Nov-06 2:06 
QuestionHow to achive application load balancing in win32 application Pin
Hemant kulkarni27-Nov-06 2:04
Hemant kulkarni27-Nov-06 2:04 
AnswerRe: How to achive application load balancing in win32 application Pin
Scott Holt27-Nov-06 15:09
Scott Holt27-Nov-06 15:09 
QuestionI am having one MFC application ,which is also having one ATL interface. Pin
chintuborntocode27-Nov-06 1:15
chintuborntocode27-Nov-06 1:15 
QuestionQuestion about CFileDialog .. Pin
Sakthiu27-Nov-06 1:15
Sakthiu27-Nov-06 1:15 
QuestionRe: Question about CFileDialog .. Pin
David Crow27-Nov-06 4:13
David Crow27-Nov-06 4:13 
QuestionTime taken by a funtion Pin
RockyJames27-Nov-06 0:52
RockyJames27-Nov-06 0:52 
AnswerRe: Time taken by a funtion Pin
Sakthiu27-Nov-06 1:10
Sakthiu27-Nov-06 1:10 

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.