Sorry, my language skills aren't up to a non-english answer...
However:
Programmer bug: yes
XP bug: no
No good OS allows reading from an address the program doesn't own, in this
case address 10.
The following is ok, since the address of a is within the application
memory:
int a =3D 23;
int *lolo =3D &a;
printf("%d",*lolo);
Old 16-bit DOS compilers would have accepted code that played around with
the pointer. Not because it is valid code, but because MS-DOS can't detect
the error.
/Per W
On Tue, 6 Jul 2004, laurent waro wrote:
> Salut =E0 tous,
> quand j'essai d'afficher une donn=E9e par l'interm=E9diare dun pointeur, =
ca
> marche pas... Type de programme : application DOS; d=E9clenchement de
> l'erreur windows ("votre application a provoqu=E9 une erreur blablabla
> blablabla...) syst=E9matiquement =E0 la ligne :
> int *lolo=3D10;
> printf("essai : %d",*lolo);
> le printf m'a l'air d'=EAtre correct, alors pourquoi quand je lance une
> compilation puis une execution sous DevC++, ca me provoque une plantage
> syst=E9matique de ma fenetre dos?
> Environnement : win XP
> NB : le m=EAme code sur une autre machine win XP avec une version de
> DevC++ plus ancienne ne fonctionne pas non plus... Sagit-il d'un
> probl=E8me li=E9 =E0 Win XP ou =E0 un mode d'emploi de DevC++ ou de print=
f non
> compris?
>
> Merci les gars et bon code!
> Greats from R=E9union Island....
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by Black Hat Briefings & Training.
> Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
> digital self defense, top technical experts, no vendor pitches,
> unmatched networking opportunities. Visit www.blackhat.com
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|