Re: declaration of variable in for loop
- From: jacob navia <jacob@xxxxxxxxxx>
- Date: Thu, 31 Jan 2008 14:21:56 +0100
Mark L Pappin wrote:
jacob navia <jacob@xxxxxxxxxx> writes:
main()
{
int i,j, *pint;
for(i=0;i<10;i++){
int k = i;
printf("%d %p = *%d\n",i,&k,k);
pint=&i;
}
*pint = 789; // Accessing illegal storage
What's illegal about it?
If the last statement inside the loop body had instead been
pint=&k;
then you might have a point.
mlp
Yes, I mistyped the name of the variable
Thanks
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
.
- References:
- declaration of variable in for loop
- From: poornimamprabhu
- Re: declaration of variable in for loop
- From: jacob navia
- declaration of variable in for loop
- Prev by Date: Re: Type conversion
- Next by Date: Re: How Do You Pronounce char?
- Previous by thread: Re: declaration of variable in for loop
- Next by thread: Re: declaration of variable in for loop
- Index(es):
Relevant Pages
|