Results 1 to 3 of 3
  1. #1
    MBD
    MBD is offline Member
    Join Date
    Sep 2011
    Location
    Sale, Cheshire
    Posts
    10
    Rep Power
    0

    Default Logical Operator error

    Hi,

    I'm trying to compile a program but I get the error: 'Unclosed string literal' but I am using the " in a while loop so it's not actually quotation marks I'm using the " as the logical operator OR.
    Any idea why it will not compile?

    The actual code i'm using is: while(choice == '\n' " choice == '\r');

    Thanks
    Martin.

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,340
    Blog Entries
    7
    Rep Power
    20

    Default Re: Logical Operator error

    The logical or operator is || (two vertical bars) not a double quote.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    MBD
    MBD is offline Member
    Join Date
    Sep 2011
    Location
    Sale, Cheshire
    Posts
    10
    Rep Power
    0

    Default Re: Logical Operator error

    Hey Jos,

    Thank you, I've been staring at it for ages.

    Cheers.

Similar Threads

  1. Logical Operator query
    By aconti in forum New To Java
    Replies: 5
    Last Post: 08-19-2011, 10:38 AM
  2. Replies: 3
    Last Post: 09-26-2010, 06:29 AM
  3. Replies: 1
    Last Post: 03-10-2010, 01:53 PM
  4. Some Logical problem
    By MuslimCoder in forum New To Java
    Replies: 4
    Last Post: 03-01-2010, 08:12 AM
  5. Replies: 4
    Last Post: 11-27-2008, 06:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •