title: Why am I getting these errors when I am trying to compile my C code?
body: <p>I am getting this error when compiling: </p>
  
  <pre><code>browninz.buildrooms.c:191:29: error: expected expression before â€˜structâ€™
           AddRandomConnection(struct room RoomA.outboundConnections, struct room RoomB.outboundConnections);
                               ^
  browninz.buildrooms.c:191:29: error: too few arguments to function â€˜AddRandomConnectionâ€™
  browninz.buildrooms.c:40:6: note: declared here
   void AddRandomConnection(struct room *RoomA, struct room *RoomB)
        ^
  </code></pre>
  
  <p>Originally I started with about 20+ errors and I have finally scaled it down to a single error within my AddRandomConnections method, I am trying to compile this code and it keeps throwing an error for this single line. I have been trying for a few hours for different methods to fix the error, but I cannot get it to go away. Can anyone help me figure out why I am getting this error? 
  Here is my code: </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;sys/stat.h&gt;
  #include &lt;sys/types.h&gt;
  /*#include &lt;stdbool.h&gt;*/
  
  typedef enum
  {
      false,
      true
  } bool;
  // Creating the template for each of the rooms via struct
  struct room
  {
      int id;
      char* name;
      char* type;
      int numOutboundConnections;
      struct room* outboundConnections[5];
  };
  
  
  
  
  // Returns true if all rooms have 3 to 6 outbound connections, false otherwise
  int IsGraphFull(struct room *structureRooms)
  {
      int k = 0;
      while (k &lt; 7){
          if (sizeof(structureRooms[k].numOutboundConnections) &lt; 3){
              return 0;
          }
          k++;
      }
      return 1;
  }
  // Adds a random outbound connection between two rooms
  void AddRandomConnection(struct room *RoomA, struct room *RoomB)
  {
      while(true)
      {
          RoomA = GetRandomRoom(RoomA);
  
          if (CanAddConnectionFrom(RoomA) == true)
              break;
      }
      do
      {
          RoomB = GetRandomRoom(RoomB);
      }
      while(CanAddConnectionFrom(RoomB) == false || IsSameRoom(RoomA, RoomB) == true || ConnectionAlreadyExists(RoomA, RoomB) == true);
  
      ConnectRoom(RoomA, RoomB); // TODO: Add this connection to the real variables,
      ConnectRoom(RoomB, RoomA); // because this A and B will be destroyed when this function terminates
  }
  
  // Returns a random Room, does NOT validate if connection can be added
  int GetRandomRoom(struct room *connections[])
  {
      // Initializes random number generator
      srand(time(0));
      // Generate random room
      int x = rand() % 7;
      return x;
  }
  
  // Returns true if a connection can be added from Room x (&lt; 6 outbound connections), false otherwise
  int CanAddConnectionFrom(struct room *RoomA)
  {
      if (sizeof(RoomA-&gt;numOutboundConnections) &lt; 6)
      {
          return 1;
      }
      else{
          return 0;
      }
  }
  // Returns true if a connection from Room x and Room y already exists, false otherwise
  int ConnectionAlreadyExists(struct room *RoomA, struct room *RoomB)
  {
      int myConnections;
      int i = 0;
      for (i; i &lt;= 6; i++){
          if ((RoomA-&gt;numOutboundConnections = RoomB-&gt;id)){
              myConnections = 1;
              break;
          }
          if(myConnections == 1)
          {
              return 1;
          }
          else
              return 0;
              }
  }
  // Connects Rooms A and B together, does not check if this connection is valid
  void ConnectRoom(struct room *RoomA, struct room *RoomB)
  {
      RoomA-&gt;numOutboundConnections = RoomB-&gt;id;
  }
  // Returns true if Rooms x and y are the same Room, false otherwise
  int IsSameRoom(struct room *RoomA, struct room *RoomB)
  {
     if (strcmp(RoomA-&gt;name, RoomB-&gt;name) == 0){
      return 1;
     }
     return 0;
  }
  
  
  
  
  int main(int argc, char* argv[])
  {
  // Room names
  char Forest[] = "Forest";
  char Beach[] = "Beach";
  char Cliff[] = "Cliff";
  char River[] = "River";
  char Cave[] = "Cave";
  char Mountain[] = "Mountain";
  char Cabin[] = "Cabin";
  char Castle[] = "Castle";
  char Fountain[] = "Fountain";
  char Homeria[] = "Homeria";
  // Initializing a room array variable to store contents of all room names
  char* roomName[] = {Forest, Beach, Cliff, River, Cave, Mountain, Cabin, Castle, Fountain, Homeria};
  // Creating the structs of 7 rooms each labeled with a name and type slot
  
      struct room Room1;
      Room1.id = 1;
      Room1.name = calloc(16, sizeof(char));
      Room1.type = calloc(16, sizeof(char));
      strcpy(Room1.type, "START_ROOM");
  
      struct room Room2;
      Room2.id = 2;
      Room2.name = calloc(16, sizeof(char));
      Room2.type = calloc(16, sizeof(char));
      strcpy(Room2.type, "MID_ROOM");
  
      struct room Room3;
      Room3.id = 3;
      Room3.name = calloc(16, sizeof(char));
      Room3.type = calloc(16, sizeof(char));
      strcpy(Room3.type, "MID_ROOM");
  
      struct room Room4;
      Room4.id = 4;
      Room4.name = calloc(16, sizeof(char));
      Room4.type = calloc(16, sizeof(char));
      strcpy(Room4.type, "MID_ROOM");
  
      struct room Room5;
      Room5.id = 5;
      Room5.name = calloc(16, sizeof(char));
      Room5.type = calloc(16, sizeof(char));
      strcpy(Room5.type, "MID_ROOM");
  
      struct room Room6;
      Room6.id = 6;
      Room6.name = calloc(16, sizeof(char));
      Room6.type = calloc(16, sizeof(char));
      strcpy(Room6.type, "MID_ROOM");
  
      struct room Room7;
      Room7.id = 10;
      Room7.name = calloc(16, sizeof(char));
      Room7.type = calloc(16, sizeof(char));
      strcpy(Room7.type, "END_ROOM");
  
  // Randomizing the room names to append to a random room #
      srand(time(0));
      struct room structureRooms[7] = {Room1, Room2, Room3, Room4, Room5, Room6, Room7};
      int i = 0;
      int array1[] = {0 ,0, 0, 0, 0, 0, 0, 0, 0, 0};
      // Loop for each of the rooms which checks to see if a name is available, if so, apply to random room
      while ( i &lt; 7 ){
          int randNum = rand() % 10;
          if (array1[randNum] == 0){
              array1[randNum] = 1;
              strcpy(structureRooms[i].name, roomName[randNum]);
              i++;
          }
      }
       // Create all connections in the graph
      while (IsGraphFull(structureRooms) == false)
      {
          AddRandomConnection(struct room RoomA.outboundConnections, struct room RoomB.outboundConnections);
      }
      // Assigning char limits
      char dirname[100];
      char dir0[100];
      char dir1[100];
      char dir2[100];
      char dir3[100];
      char dir4[100];
      char dir5[100];
      char dir6[100];
  
  
      // Generate the "rooms" directory name with the PID
      sprintf(dirname, "./browninz.rooms%d", getpid());
  
      // Generate the room names concatenated with the directory name
      sprintf(dir0, "%s/Room1", dirname);
      sprintf(dir1, "%s/Room2", dirname);
      sprintf(dir2, "%s/Room3", dirname);
      sprintf(dir3, "%s/Room4", dirname);
      sprintf(dir4, "%s/Room5", dirname);
      sprintf(dir5, "%s/Room6", dirname);
      sprintf(dir6, "%s/Room7", dirname);
  
      // Create a new directory that the "rooms" files will be stored in
      mkdir(dirname, 0770);
  
      // Pointer files of each of the rooms
      FILE *myRoom1;
      FILE *myRoom2;
      FILE *myRoom3;
      FILE *myRoom4;
      FILE *myRoom5;
      FILE *myRoom6;
      FILE *myRoom7;
      // Now opening the room files / directories to create or write them in the folder.
      myRoom1 = fopen(dir0, "w+");
      myRoom2 = fopen(dir1, "w+");
      myRoom3 = fopen(dir2, "w+");
      myRoom4 = fopen(dir3, "w+");
      myRoom5 = fopen(dir4, "w+");
      myRoom6 = fopen(dir5, "w+");
      myRoom7 = fopen(dir6, "w+");
      // Creating a pointer array of all of the room pointers
      FILE *myRooms[7] = {myRoom1, myRoom2, myRoom3, myRoom4, myRoom5, myRoom6, myRoom7};
      // Printing room file name, type, and connections and iterates for each room
      int counter = 0;
      while (counter &lt; 7) {
          fprintf(myRooms[counter], "ROOM NAME: %s\n", structureRooms[counter].name);
          fprintf(myRooms[counter], "ROOM TYPE: %s\n", structureRooms[counter].type);
         // fprintf(myRooms[counter], "CONNECTION 1: %s\n", structureRooms[counter].outboundConnections[counter]);
         // test to see if connection works
          fprintf(myRooms[counter], "CONNECTION 1: %s\n", structureRooms[counter].name);
          counter++;
      }
      return 0;
      }
  </code></pre>