Skip to content

Double quotes in examples cannot be compiled  #699

Closed
@leonty

Description

@leonty

Sometimes in the examples I see characters that cannot really be used in a sketch. For example the non-symmetric double quotes:

You can pass flash-memory based strings to Serial.print() by wrapping them with F(). For example:
Serial.print(F(“Hello World”))

That just gives a compilation error if copied into the sketch:

sketch_sep03a:8:1: error: stray '\342' in program
Serial.print(“Hello World”);
^
sketch_sep03a:8:1: error: stray '\200' in program
sketch_sep03a:8:1: error: stray '\234' in program
sketch_sep03a:8:1: error: stray '\342' in program
sketch_sep03a:8:1: error: stray '\200' in program
sketch_sep03a:8:1: error: stray '\235' in program
/Users/leonty/Documents/Arduino/sketch_sep03a/sketch_sep03a.ino: In function 'void loop()':
sketch_sep03a:8:17: error: 'Hello' was not declared in this scope
Serial.print(“Hello World”);
^
exit status 1
stray '\342' in program

I propose to replace them by normal programming double quotes "".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions