Forum : Why error for ch = ch 2 ?
Brief description  about Online courses   join in Online courses
View Arindam Ghosh Roy 's Profile

Why error for ch = ch 2 ?

I have a char( character ) , say 'ch'.

char ch = 'A'; //Suppose
ch = 2; //This does not give compilation error
ch = ch 2; //This gives compilation error

Why ?
Asked by Arindam Ghosh Roy | Jun 15, 2010 |  Reply now
Replies (2)
View arindam ghosh-roy 's Profile
Something has gone wrong in the post. It is not the same as i posted.
It is actually,
ch += 2;
ch = ch+2;
Jun 15, 2010
View gurpreet kohli 's Profile
i thnk theres space between ch and 2...thats why.
Jun 15, 2010