Home c Is there a language with the ability to create an array with...

Is there a language with the ability to create an array with elements of type STRUCT

Author

Date

Category

Is it possible to fill the two-dimensional array with elements of type struct if so, how and then when searching for the array of them to find them? My example is correct?

Typeedef struct {
    'trash_t field [14] [21]';
    Int Player_Order;
    int moves_num;
  } GameState_T;
  TypeDef struct {
    INT COORD;
    CHAR DIRECTION;
    INT SPEED;
    Char Parameters [4];
  } 'trash_t;'

Answer 1, Authority 100%

No problem. For example:

Typeedef struct {
  INT COORD;
  CHAR DIRECTION;
  INT SPEED;
  Char Parameters [4];
} trash_t;
TypeDef struct {
  trash_t field [14] [21];
  Int Player_Order;
  int moves_num;
} GameState_T;
INT MAIN ()
{
  GameState_T G [5];
  g [1] .field [3] [8] .parameters [1] = 'a';
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions