ERROR: expected primary-expression

I'm getting
expected primary-expression before '=' token
for lines 40 and 43, sum and sumHits. I don't know what I'm doing wrong :/. Why am I not getting the same error for average?? Thanks!!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include <stdio.h>
using namespace std;

//Define batting values
#define H = 1
#define h = 1
#define O = 1
#define o = 1
#define W = 0
#define w = 0
#define S = 0
#define s = 0
#define P = 0
#define p = 0

int main ()
{
    int player;                 //Assign player number
    double sum;                 //Assign variable for sum of H, h and O, o
    double sumHits;             //Assign variable for sum of only H and h
    double average;             //Assign variable for average of H and O
    char size[100];             //Allows compiler to view user input as array
    int b;                      //Assign variable for integer size
    int letters = 0;            //Assing value of 0 to allow compiler to count
    
    cout << "\t\t\tBatting Average Calculator\t\t";
    
    cout << "\n\nEnter the player's number: ";
    cin >> player;
   
    cout << "\nEnter the player's batting record: ";
    cin >> size;
        {b = 0;
         while (size[b] != 0)
         if (( size[b] = 'h','o','w','s','p') || (size[b] = 'H','O','W','S','P'))
         { letters++; b++; }}
        
    //Summate H, h, O, o
    sum = H + h + O + o;
    
    //Summate 
    sumHits = H + h;
    
    //Calculate batting average
    average = sumHits/sum;
    
    cout << "Player " << player << "'s record: " << size << endl;
    cout << "Player " << player << "'s batting average: " << average << endl;
    
    return 0;
}


This is how you define something:

#define number 1

not:

#define number = 1
I think my rookie is showing. Thanks!!
Topic archived. No new replies allowed.