Click here to Skip to main content
15,071,399 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to handle runtime access violation exception Pin
Jochen Arndt3-Jul-16 21:29
professionalJochen Arndt3-Jul-16 21:29 
AnswerRe: How to handle runtime access violation exception Pin
leon de boer4-Jul-16 20:46
Memberleon de boer4-Jul-16 20:46 
QuestionProblem with C++ arrays. Pin
Ratul Thakur30-Jun-16 3:15
MemberRatul Thakur30-Jun-16 3:15 
AnswerRe: Problem with C++ arrays. Pin
jeron130-Jun-16 4:17
Memberjeron130-Jun-16 4:17 
AnswerRe: Problem with C++ arrays. Pin
k505430-Jun-16 4:29
mvek505430-Jun-16 4:29 
GeneralRe: Problem with C++ arrays. Pin
Ratul Thakur30-Jun-16 5:47
MemberRatul Thakur30-Jun-16 5:47 
GeneralRe: Problem with C++ arrays. Pin
k505430-Jun-16 6:06
mvek505430-Jun-16 6:06 
AnswerRe: Problem with C++ arrays. Pin
Patrice T2-Jul-16 13:14
mvePatrice T2-Jul-16 13:14 
It is possible because C and C++ do not check array boundaries, this behavior make them fast at cost of security.
In such a small program, you see no consequences, but bigger program, you will see another variable suddenly changing of value when it is not supposed to.
C++
int a[2];
int b;
b= 0;
a[3]=10;
cout<<a[3]<<endl;
cout<<b<<endl;

In this example, b may end up with 10 depending on compiler details
Patrice

“Everything should be made as simple as possible, but no simpler.” Albert Einstein

GeneralRe: Problem with C++ arrays. Pin
leon de boer2-Jul-16 22:31
Memberleon de boer2-Jul-16 22:31 
AnswerRe: Problem with C++ arrays. Pin
Henry Faure4-Jul-16 9:26
MemberHenry Faure4-Jul-16 9:26 
GeneralRe: Problem with C++ arrays. Pin
jeron15-Jul-16 5:29
Memberjeron15-Jul-16 5:29 
GeneralRe: Problem with C++ arrays. Pin
Super Lloyd6-Jul-16 17:34
MemberSuper Lloyd6-Jul-16 17:34 
GeneralRe: Problem with C++ arrays. Pin
jeron17-Jul-16 6:07
Memberjeron17-Jul-16 6:07 
GeneralRe: Problem with C++ arrays. Pin
Super Lloyd7-Jul-16 14:38
MemberSuper Lloyd7-Jul-16 14:38 
QuestionCFileStatus m_mtime problems Pin
Member 1253112930-Jun-16 2:09
MemberMember 1253112930-Jun-16 2:09 
AnswerRe: CFileStatus m_mtime problems Pin
Eddy Vluggen30-Jun-16 2:29
professionalEddy Vluggen30-Jun-16 2:29 
GeneralRe: CFileStatus m_mtime problems Pin
Member 1253112930-Jun-16 2:33
MemberMember 1253112930-Jun-16 2:33 
GeneralRe: CFileStatus m_mtime problems Pin
Eddy Vluggen30-Jun-16 2:54
professionalEddy Vluggen30-Jun-16 2:54 
GeneralRe: CFileStatus m_mtime problems Pin
Member 1253112930-Jun-16 3:14
MemberMember 1253112930-Jun-16 3:14 
AnswerRe: CFileStatus m_mtime problems Pin
Richard MacCutchan30-Jun-16 2:54
mveRichard MacCutchan30-Jun-16 2:54 
AnswerRe: CFileStatus m_mtime problems Pin
Jochen Arndt30-Jun-16 3:06
professionalJochen Arndt30-Jun-16 3:06 
AnswerRe: CFileStatus m_mtime problems Pin
Member 1253112930-Jun-16 21:51
MemberMember 1253112930-Jun-16 21:51 
QuestionCompile dll in Ubuntu to include in Windows 7 (32 bit) program Pin
Member 1224497229-Jun-16 6:41
MemberMember 1224497229-Jun-16 6:41 
AnswerRe: Compile dll in Ubuntu to include in Windows 7 (32 bit) program Pin
Jochen Arndt29-Jun-16 7:08
professionalJochen Arndt29-Jun-16 7:08 
AnswerRe: Compile dll in Ubuntu to include in Windows 7 (32 bit) program Pin
leon de boer29-Jun-16 7:22
Memberleon de boer29-Jun-16 7:22 

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.