Reserved characters in an array?

This is a discussion on Reserved characters in an array? within the Networking/Device Communication forums, part of the General Programming Boards category; Hi, I was just trying to get this string into an array: unsigned char incoming[] = "+CMTI: "SM",1" The problem ...

  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 01: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
    32,824
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 06:19 AM
  3. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 01: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-10-2002, 12:19 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21