Re: why do the following crash
- From: "Bartc" <bc@xxxxxxxxxx>
- Date: Mon, 31 Mar 2008 16:03:13 GMT
<parag_paul@xxxxxxxxxxx> wrote in message
news:f5b46a43-52b2-45e2-8bfe-979c20e33dc7@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
File1.c
int arr[80];
File2.c
extern int *arr;
int main()
{
arr[1] = 100;
return 0;
}
The declarations for the arr variable don't match.
Try extern int arr[80] in File2.c.
(I know arrays and pointers are /supposed/ to be interchangeable. But there
is a subtle difference between: int a[80] and int *a)
--
Bart
.
- Follow-Ups:
- Re: why do the following crash
- From: Philip Potter
- Re: why do the following crash
- References:
- why do the following crash
- From: parag_paul@xxxxxxxxxxx
- why do the following crash
- Prev by Date: Re: CERT C Secure Coding Standard - last call for reviewers
- Next by Date: Re: CERT C Secure Coding Standard - last call for reviewers
- Previous by thread: Re: why do the following crash
- Next by thread: Re: why do the following crash
- Index(es):
Relevant Pages
|