Thread: Difference between array initialization

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    62

    Difference between array initialization

    Code:
    char a[10] = {0};
    char a[10] = {0x0};

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    There shouldn't be anything different between those two, I believe. You're just referring to the same thing using different base systems.

    This is just a hunch, though.
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    62
    Just as I thought:

    0x0 is base 16 for 0
    0 is base 10 for 0

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Array Initialization
    By niteshsood in forum C Programming
    Replies: 2
    Last Post: 04-13-2009, 06:22 AM
  2. initialization of char array (c style string)
    By manzoor in forum C++ Programming
    Replies: 1
    Last Post: 09-24-2008, 06:29 AM
  3. Replies: 10
    Last Post: 11-06-2005, 09:29 PM
  4. Two-Dimensional Array Initialization (please help)
    By pompey4life in forum C Programming
    Replies: 2
    Last Post: 10-17-2005, 07:09 PM
  5. Template Array Class
    By hpy_gilmore8 in forum C++ Programming
    Replies: 15
    Last Post: 04-11-2004, 11:15 PM