Const data member initizialisation

Im writing a class Book, which has several data members and 1 const data member. My problem is that i need to put conditions on the const data members but I have no idea how to do so.


1
2
3
4
5
6
7
8
9
10
11
12
13
class Book
{
private:
	
	char *BookName;
	const char Category;
	int Pages;
	int Pub_Date;
	double Price;
	
Book(char Array[],int N,int P,int K, int D,int C):Category((C='R' || C='A' || C='S')?C:'S')   //Here is the error
	// the other set functions
}


Any help would be much appreciated.
Regards.
Relational operator for "equal to" check is "==" (double/two equal signs).

 
@11 Book(char Array[],int N,int P,int K, int D,int C):Category((C='R' || C='A' || C='S')?C:'S')

Should be
 
@11 Book(char Array[],int N,int P,int K, int D,int C):Category((C=='R' || C=='A' || C=='S')?C:'S')
Thank you very much.
Topic archived. No new replies allowed.