user27439: I am getting the error in my title when I try to compile the following code:
#define char incomingByte; //Defines incomingByte 
#define char sendBack = K;
#define char ?;
#define pollTime;

bool running = true;

void setup() {
Serial.begin(9600); //Set data rate.
}

void loop() {
for(Serial.available() > 0;)  { //Gets you the number of bytes that are available to be read from the serial port.
pollTime = delayMicroseconds(200); // Sets a poll time of 200 microseconds.
incomingByte  = Serial.read();
if(incomingByte = ?) {
Serial.print(sendBack);
  }
 }
}  


user10794: Your code is completely wrong in almost every respect.

#define char incomingByte; //Defines incomingByte 

That line means that the compiler will substitute incomingByte; whenever it sees char.

#define char sendBack = K;

Now it will substitute sendBack = K; when it sees char.

#define char ?;

Now it will substitute ?; when it sees char.

#define pollTime;

I don't know what you are thinking here. If you are trying to declare a variable you have to give a type, like this:
int pollTime;


bool running = true;

void setup() {
Serial.begin(9600); //Set data rate.
}
void loop() {

Those lines are OK.

for(Serial.available() > 0;)  { //Gets you the number of bytes that are available to be read from the serial port.

You don't want the semicolon there. A for loop is not written like that. You possibly mean while, ie.
while(Serial.available() > 0) 


pollTime = delayMicroseconds(200); // Sets a poll time of 200 microseconds.

That is doing nothing of the sort. It is delaying 200 µs, it isn't setting anything.

incomingByte  = Serial.read();

That line is OK, assuming you declared incomingByte like this, and not the way you did:
char incomingByte; 


if(incomingByte = ?) {

That needs to be in single quotes, as you are comparing a character. Also you compare with == not = ie.
if(incomingByte == '?') {


Serial.print(sendBack);

It looks from your earlier code you mean:
Serial.print('K');


  }
 }
}  

These lines look OK.

I suggest you read a beginners page about C programming. This is just pure guesswork what you are doing here. For one thing, read up on how #define works. Here is one page: https://www.techonthenet.com/c_language/constants/create_define.php. And another: http://www.cprogramming.com/reference/preprocessor/define.html

27439: <p>I am getting the error in my title when I try to compile the following code:</p>

<pre><code>#define char incomingByte; //Defines incomingByte 
#define char sendBack = K;
#define char ?;
#define pollTime;

bool running = true;

void setup() {
Serial.begin(9600); //Set data rate.
}

void loop() {
for(Serial.available() &gt; 0;)  { //Gets you the number of bytes that are available to be read from the serial port.
pollTime = delayMicroseconds(200); // Sets a poll time of 200 microseconds.
incomingByte  = Serial.read();
if(incomingByte = ?) {
Serial.print(sendBack);
  }
 }
}  
</code></pre>
 10794: <p>Your code is completely wrong in almost every respect.</p>

<hr>

<pre><code>#define char incomingByte; //Defines incomingByte 
</code></pre>

<p>That line means that the compiler will substitute <code>incomingByte;</code> whenever it sees <code>char</code>.</p>

<hr>

<pre><code>#define char sendBack = K;
</code></pre>

<p>Now it will substitute <code>sendBack = K;</code> when it sees <code>char</code>.</p>

<hr>

<pre><code>#define char ?;
</code></pre>

<p>Now it will substitute <code>?;</code> when it sees <code>char</code>.</p>

<hr>

<pre><code>#define pollTime;
</code></pre>

<p>I don't know what you are thinking here. If you are trying to <em>declare</em> a variable you have to give a type, like this:</p>

<pre><code>int pollTime;
</code></pre>

<hr>

<pre><code>bool running = true;

void setup() {
Serial.begin(9600); //Set data rate.
}
void loop() {
</code></pre>

<p>Those lines are OK.</p>

<hr>

<pre><code>for(Serial.available() &gt; 0;)  { //Gets you the number of bytes that are available to be read from the serial port.
</code></pre>

<p>You don't want the semicolon there. A <code>for</code> loop is not written like that. You possibly mean <code>while</code>, ie.</p>

<pre><code>while(Serial.available() &gt; 0) 
</code></pre>

<hr>

<pre><code>pollTime = delayMicroseconds(200); // Sets a poll time of 200 microseconds.
</code></pre>

<p>That is doing nothing of the sort. It is delaying 200 µs, it isn't setting anything.</p>

<hr>

<pre><code>incomingByte  = Serial.read();
</code></pre>

<p>That line is OK, assuming you declared <code>incomingByte</code> like this, and not the way you did:</p>

<pre><code>char incomingByte; 
</code></pre>

<hr>

<pre><code>if(incomingByte = ?) {
</code></pre>

<p>That needs to be in single quotes, as you are comparing a character. Also you compare with <code>==</code> not <code>=</code> ie.</p>

<pre><code>if(incomingByte == '?') {
</code></pre>

<hr>

<pre><code>Serial.print(sendBack);
</code></pre>

<p>It looks from your earlier code you mean:</p>

<pre><code>Serial.print('K');
</code></pre>

<hr>

<pre><code>  }
 }
}  
</code></pre>

<p>These lines look OK.</p>

<hr>

<p>I suggest you read a beginners page about C programming. This is just pure guesswork what you are doing here. For one thing, read up on how <code>#define</code> works. Here is one page: <a href="https://www.techonthenet.com/c_language/constants/create_define.php" rel="nofollow">https://www.techonthenet.com/c_language/constants/create_define.php</a>. And another: <a href="http://www.cprogramming.com/reference/preprocessor/define.html" rel="nofollow">http://www.cprogramming.com/reference/preprocessor/define.html</a></p>
