Difference between array initialization

This is a discussion on Difference between array initialization within the C Programming forums, part of the General Programming Boards category; Code: char a[10] = {0}; char a[10] = {0x0};...

  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,069
    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, 08: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

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