0

I am facing some error when calling a method for retrieving the data form sqlite.

error: stray '\302' in program at this line

printf("%d", sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL)); 

please tell me where I am wrong..

tech.samar
  • 152
  • 2
  • 12
  • The full doublet is `error: stray '\302'. error: stray '\240'` (not reported in the question). There is a single Unicode code point U+00A0 ([NO-BREAK SPACE](https://www.charset.org/utf-8)) in the source code, UTF-8 sequence 0xC2 0xA0 (hexadecimal), 302 240 (octal). It can be searched for by regular expression `\x{00A0}` in any modern text editor or IDE (the notation is different in Visual Studio Code (and probably others): `\u00A0` (instead of `\x{00A0}`)). – Peter Mortensen Apr 30 '23 at 02:56
  • Most give rise to an error ***triplet***, but for NO-BREAK SPACE it is only two. – Peter Mortensen Apr 30 '23 at 02:58
  • This is a ***very*** common error when copying code from web pages, [PDF](https://en.wikipedia.org/wiki/Portable_Document_Format) documents, through chat (e.g. [Skype Chat](https://en.wikipedia.org/wiki/Features_of_Skype#Skype_chat) or [Facebook Messenger](https://en.wikipedia.org/wiki/Facebook_Messenger)), etc. The canonical question is *[Compilation error: stray ‘\302’ in program, etc.](https://stackoverflow.com/questions/19198332)*. – Peter Mortensen Apr 30 '23 at 03:00

2 Answers2

1

this is a compiler error, isn't it? Try to remove the whole line and write it again by hand, do not copy it!

You have a invalid character in that line.

Matthias Bauch
  • 89,811
  • 20
  • 225
  • 247
0

stray '\302'

This error comes if you have used any invalid characters inside your code. This is a compile time error. So what you can do is remove the whole line.(i.e. take the cursor to the staring of the line and then press -commandkey+ right arrow) and rewrite the line again.

Hope this helps...

hAPPY iCODING...

Suresh Varma
  • 9,750
  • 1
  • 60
  • 91