expected primary-expression before '=' token

I am working on a school project to get a path to write to a text file, and get this error when I verify the code. Here is the complete code

#include <SPI.h>
#include <SD.h>
File myFile;
int coord[2][300];

void setup() {
  // SD card check
  Serial.begin(9600);
  Serial.print("Initializing SD card...");
  if (!SD.begin(4))
  {
    Serial.println("initialization failed!");
    while (1);
  }
  Serial.println("initialization done.");

  //Declarations
  int n[300];

  // open the file for reading:
  myFile = SD.open("data.txt");
  if (myFile)
  {
    Serial.println("data.txt:");

  // read from the file and output int values to n array
  /*
    while (myFile.available())
    {
    arrayOfChars = myFile.read();
    }
    myFile.close();
    for (int i=0; i<300; i++)
    {
      n[i] = atoi(arrayOfChars);
    }
  }
  else{
    Serial.println("error opening test.txt");
  }
*/  
/*
 The coord array has 2 rows and 300 columns. 
 [1][i] is the x axis
 [2][i] is the y axis
 */
 



//Finds size of array and building output code to text file
//int size = sizeof(n) / sizeof(int);
myFile = SD.open("map.txt", FILE_WRITE);
  for (int i=300; i>0; i--)    //i equals whatever the length of the array is
  {
   int x=1;
   while (x<i)
   {
     myFile.print(" ");
     x++;
   }
    if (round(coord[1][i]-coord[1][i-1]))= 0) //ERROR?
    {
      if (round(coord[2][i]-coord[2][i-1]) > 0)
      {
        up = round(coord[2][i]-coord[2][i-1]);
        while (up >= 1)
        {
          myFile.println("|"); //not sure if this will be in the same line
          up--;
        }
      elseif (round(coord[2][i]-coord[2][i-1]) < 0)
      {
        down = round(coord[2][i]-coord[2][i-1]);
        while (down >= 1)
        {
         myFile.println(" "); //prints on the next line down
         myFile.println("|"); 
         down--; 
        }
      }
      else 
      {
        //do nothing           
      }
     }
     if (round(coord[2][i]-coord[2][i-1]))== 0)
     {
      if (round(coord[1][i]-coord[1][i-1]) > 0)
      {
        right = round(coord[2][i]-coord[2][i-1]);
        while (right >= 1)
        {
          myFile.print("_");
          right--;
        }
      elseif (round(coord[1][i]-coord[1][i-1]) < 0)
      {
        left = round(coord[2][i]-coord[2][i-1]);
        while (left >= 1)
        {
         myFile.print("_"); //not sure how to go back with the _ line
         down--; 
        }
      }
      else 
      {
        //do nothing           
      }
     }
    }
   }
  }

Where is arrayOfChars declared?

Further myFile.read() reads a single character, not an array.

I commented that part out since I am still working on it. I am having trouble after this line of code:

/*
 The coord array has 2 rows and 300 columns. 
 [1][i] is the x axis
 [2][i] is the y axis
 */
    if (round(coord[1][i]-coord[1][i-1]))= 0) //ERROR?

Yes. Count the number of begin parentheses and the number of end parentheses. They should be equal.
You will also have trouble with "=". One "=" is an assignment statement which is why you get the error message because the left of an assignment must be a variable, not an expression. Two "==" is the comparison operator which would make more sense there.

Pete

Thanks. You helped me solve my problem.

jtsao3:
Thanks. You helped me solve my problem.

Hopefully, the solution you found also included correcting the out-of-bounds array accesses.