Can you explain me about this?

This is a discussion on Can you explain me about this? within the C++ Programming forums, part of the General Programming Boards category; Hey guys. Can you explain me about this? char a[8][4][10] what does it mean?...

  1. #1
    cpn
    cpn is offline
    Registered User
    Join Date
    Dec 2012
    Posts
    3

    Can you explain me about this?

    Hey guys. Can you explain me about this?

    char a[8][4][10]

    what does it mean?

  2. #2
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,681
    This is a 3 dimensional array of chars. The first dimension is 8, the second 4 and the third 10.

    If you want to access the (i,j,k)-th element you have to write
    Code:
    a[i][j][k]
    By curiosity, where do you need that?
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  3. #3
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,587
    I hope this is not supposed to represent some 2D string array...?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,425
    what do you need it for? or in what context are you expected to use it? As stated already it is a 3d array - that is it can be used to express let's say blocks within a cube [3][3][3]
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can someone explain to me
    By roelof in forum C++ Programming
    Replies: 11
    Last Post: 06-20-2010, 03:56 AM
  2. Can anyone explain this?
    By monaco87 in forum C Programming
    Replies: 2
    Last Post: 10-30-2007, 07:15 AM
  3. Can someone explain to me
    By rEtard in forum Windows Programming
    Replies: 1
    Last Post: 06-22-2005, 11:09 AM
  4. Could someone explain why this happens
    By GSLR in forum C Programming
    Replies: 3
    Last Post: 05-13-2003, 09:27 AM
  5. Please explain...
    By robid1 in forum C Programming
    Replies: 4
    Last Post: 03-19-2003, 04:49 PM

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