Thread: Reserved characters in an array?

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    2

    Reserved characters in an array?

    Hi, I was just trying to get this string into an array:

    unsigned char incoming[] = "+CMTI: "SM",1"

    The problem of course is I can't seem to get quote marks into a string as they think that the " before S is marking the end of the string .

    I was going to try :

    unsigned char incoming [13] = {'+','C','M',....}

    That works....or at least appears to but when i compare the two strings they dun seem to match.

    Regards,
    Xolstis
    Last edited by xolstis; 09-02-2004 at 12:17 AM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Like so
    unsigned char incoming[] = "+CMTI: \"SM\",1";
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    2
    thanx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. erase all characters in a character array?
    By diddy02 in forum C Programming
    Replies: 4
    Last Post: 11-20-2008, 05:30 PM
  2. storing a pattern of characters into a 2D array
    By haroonie in forum C Programming
    Replies: 2
    Last Post: 04-20-2005, 05:19 AM
  3. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM
  4. Can a string be converted to an array of characters?
    By supaben34 in forum C++ Programming
    Replies: 8
    Last Post: 12-08-2002, 12:18 PM
  5. Characters in an Array
    By Xenmordoc in forum C++ Programming
    Replies: 4
    Last Post: 05-09-2002, 11:19 PM