This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stray \302 error


On Wed, Aug 31, 2011 at 11:29 PM, Jeffrey Walton <noloader@gmail.com> wrote:
>
> On Wed, Aug 31, 2011 at 6:53 AM, Avinash Sonawane
> <avinash.sonawane1990@gmail.com> wrote:
> > Respected Sir,
> > I am using gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
> > I wrote one simple program but after compiling it, its showing me some
> > unusual errors .
> > Please help.
> >
> > Program:
> >
> > # include <stdio.h>
> > # include <stdlib.h>
> >
> > Âint main()
> > Â{
> > Âint *p;
> > Âint n,i;
> >
> > Âprintf("No. Of Elements = ");
> > Âscanf("%d",&n);
> >
> > Âp = (int *) malloc(n*sizeof(int));
> >
> > Âfor(i=0;i<n;i++)
> > Âscanf("%d",(p+i));
> >
> > Â for(i=0;i<n;i++)
> > Âprintf("%d\t",*(p+i));
> >
> > Âprintf("\n");
> >
> > Âfree(p);
> >
> > Âreturn 0;
> > Â}
> >
> > Terminal:
> >
> > avinash@titanic:/Remastersys/Documents/Programs/c$ gcc dm.c -o dm
> > dm.c: In function âmainâ:
> > dm.c:17:1: error: stray â\302â in program
> > dm.c:17:1: error: stray â\240â in program
> You have copy/pasted code from the web. I ran across the same issue

Sorry but I have not copied it from anywhere else and that's why I am
more curious as how did that character get into my program.
> when copy/paste from code.google.com in the past.
>
> You will see the miscreant characters in a hex editor. You will *not*
> see them using gedit. And gedit does not properly search/replace - you
> will need to use emacs, vi, etc.
>

Thanks for the guidance. For that matter I'll go for vi.
> Jeff



--
Avinash Sonawane
PICT Pune
India


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]