Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

ajitnath

  • 3 years ago

A C programming question :- a string can be declared as either char a[ ] = "Mystring" char *a = "Mystring" an array of strings char *a[ ] = {Some strings} why doesn't this work ? char a[ ][ ] = {Some strings}

  • This Question is Open
  1. infinity_
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    it works :P why do you think it doesn't?

  2. rsmith6559
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    a is being declared as a two dimensional array of char. It's being initialized with one dimension. a[0] = {Some strings} would be more proper, except that, if I remember correctly, the size of the first index HAS to have a value in the declaration.

  3. thangeram
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    bcoz its two dimensional array cant be declare in single dimension

  4. thangeram
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    sry i mean single blocks

  5. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy