title: Structure - Access Structure element without . and ->
body: <p>I am required to access some elements from nested structure without using <code>.</code> and <code>-&gt;</code></p>
  
  <p>I need to print out the values for <code>keyValue</code> and <code>alternateKeyValue</code> from the Test laptop definition without using the <code>.</code> or <code>-&gt;</code> operators to directly reference the qwerty struct or its members.</p>
  
  <p>Here's the structure.</p>
  
  <pre><code>typedef struct
  {
      bool leftButton;
      bool rightButton;
      bool middleButton;
      bool mouseOn;
      mouse_direction_E direction;
  } mouse_S;
  
  typedef struct
  {
      char keyValue;
      char alternateKeyValue;
  } keyboard_S;
  
  typedef struct
  {    
      mouse_S simpleMouse;
      keyboard_S qwerty;
  } laptop_S;
  
  laptop_S test=
  {
  
      .simpleMouse =
      {
          .leftButton = false,
          .rightButton = false,
          .middleButton = false,
          .mouseOn = false,
          .direction = MOUSE_NONE,
      },
      .qwerty =
      {
          .keyValue = '5',
          .alternateKeyValue = '%'
      },
  };
  
  int main()
  {
  
      char c = tesla.qwerty.keyValue;
      char d = tesla.qwerty.alternateKeyValue;
      printf("KeyValue = %c\n", c);
      printf("alternateKeyValue = %c\n", d);
  }
  </code></pre>
  
  <p>This works, but is there a way to access <code>KeyValue</code> and <code>alternateKeyValue</code> without using '.'?</p>