Thread: Syntax Question

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    15

    Talking Syntax Question

    I want to pass text into a variable the has the " character. When it gets to the second " character it is treating it as the end of the statement creating a syntax error. I want it to treat the second and third " characters in my statement below as characters. Is there a way to do this in C++? My code is below. Thank you in advance for looking and helping.

    Derek

    Code:
      csDesc = "the average ("person") will accept";

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    use \"

  3. #3
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Code:
    csDesc = "the average (\"person\") will accept";
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  4. #4
    Registered User
    Join Date
    Mar 2005
    Posts
    15

    Thank you.

    Thank you both for your replies!!!

    Derek

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Syntax question: &(++x)
    By yoshiznit123 in forum C Programming
    Replies: 8
    Last Post: 06-02-2006, 10:40 PM
  2. using c++ in c code
    By hannibar in forum C Programming
    Replies: 17
    Last Post: 10-28-2005, 09:09 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM
  5. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM