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

C / C++ / MFC

 
QuestionRe: Vector inside a structure Pin
vinodkoul2-Aug-07 20:43
vinodkoul2-Aug-07 20:43 
AnswerRe: Vector inside a structure Pin
cp98762-Aug-07 20:54
cp98762-Aug-07 20:54 
QuestionPrint value of key pressed...? Pin
deostroll2-Aug-07 18:22
deostroll2-Aug-07 18:22 
AnswerRe: Print value of key pressed...? Pin
bob169722-Aug-07 18:43
bob169722-Aug-07 18:43 
QuestionRe: Print value of key pressed...? Pin
deostroll2-Aug-07 18:59
deostroll2-Aug-07 18:59 
AnswerRe: Print value of key pressed...? Pin
David Crow3-Aug-07 3:52
David Crow3-Aug-07 3:52 
AnswerRe: Print value of key pressed...? Pin
bob169723-Aug-07 17:39
bob169723-Aug-07 17:39 
Questionaccess violation in int array Pin
George_George2-Aug-07 16:53
George_George2-Aug-07 16:53 
Hello everyone,


There is error message when executing my program,

Unhandled exception at 0x00411a49 in test_entern.exe: 0xC0000005: Access violation reading location 0x00000002.

It is very simple, does anyone know what is wrong with the program?

I have tested that when changing from extern int* p_int to extern int p_int[16], my program is ok. But I think the two statements should be the same, right?

foo.c

<br />
int p_int [16] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};<br />


goo.c

<br />
extern int* p_int;<br />
<br />
int main (int argc, char** argv)<br />
{<br />
        int i;<br />
        int sum = 0;<br />
        for (i = 0; i < 16; i++)<br />
        {<br />
                sum += p_int [i]; // access violation<br />
        }<br />
<br />
        return 0;<br />
}<br />



thanks in advance,
George
AnswerRe: access violation in int array Pin
Sameerkumar Namdeo2-Aug-07 17:17
Sameerkumar Namdeo2-Aug-07 17:17 
GeneralRe: access violation in int array Pin
George_George2-Aug-07 18:24
George_George2-Aug-07 18:24 
AnswerRe: access violation in int array Pin
JudyL_MD3-Aug-07 1:48
JudyL_MD3-Aug-07 1:48 
GeneralRe: access violation in int array Pin
George_George3-Aug-07 21:42
George_George3-Aug-07 21:42 
QuestionCrashes Pin
dellthinker2-Aug-07 16:50
dellthinker2-Aug-07 16:50 
AnswerRe: Crashes Pin
Hans Dietrich2-Aug-07 19:05
mentorHans Dietrich2-Aug-07 19:05 
GeneralRe: Crashes Pin
dellthinker3-Aug-07 9:49
dellthinker3-Aug-07 9:49 
QuestionCFileDialog saving problem Pin
hxhl952-Aug-07 15:16
hxhl952-Aug-07 15:16 
AnswerRe: CFileDialog saving problem Pin
Naveen2-Aug-07 15:56
Naveen2-Aug-07 15:56 
GeneralRe: CFileDialog saving problem Pin
hxhl953-Aug-07 6:42
hxhl953-Aug-07 6:42 
GeneralRe: CFileDialog saving problem Pin
Naveen3-Aug-07 14:56
Naveen3-Aug-07 14:56 
AnswerRe: CFileDialog saving problem Pin
David Crow3-Aug-07 4:02
David Crow3-Aug-07 4:02 
QuestionFont Dialog Box? Setting the font? Pin
deostroll2-Aug-07 13:07
deostroll2-Aug-07 13:07 
AnswerRe: Font Dialog Box? Setting the font? Pin
Michael Dunn2-Aug-07 13:56
sitebuilderMichael Dunn2-Aug-07 13:56 
AnswerRe: Font Dialog Box? Setting the font? Pin
Mark Salsbery2-Aug-07 13:56
Mark Salsbery2-Aug-07 13:56 
Questionhaving problem terminating a thread Pin
alberthyc2-Aug-07 8:49
alberthyc2-Aug-07 8:49 
QuestionRe: having problem terminating a thread Pin
Mark Salsbery2-Aug-07 8:55
Mark Salsbery2-Aug-07 8:55 

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.