Main Menu


Sponsored Links

  


  
  
Web Cartoon Maker: a Fun Way to Learn C++ Contents Previous Next

Operators for Characters

Just a reminder, we are still not talking about cartoon characters. We are talking about symbols or letters which make up strings, i.e., the char variable type.

Interestingly, the same mathematical operations that work on integers also work on characters. For example :

char cLetter;

cLetter = 'a'; // cLetter has 'a' value now

cLetter = 'a' + 1 ; // cLetter has 'b' value now

The last line gives a result that uses the fact that the character is stored as an integer even though it is of type char. The standard (ASCII) value for ‘a’ is 97 and for ‘b’ is 98. Similarly ‘a’ – 3 will give ‘^’.

Although it is syntactically legal to multiply characters, it is almost never useful to do it.


Contents Previous Next
  
News

New Tales Animator Video by Alan Sturgess

Alan Sturgess shared an excellent video he made using Tales Animator! You can still download Tales Animator here. Unfortunately it is only available for Wi

...

Simple Online Character Designer

There is a prototype of simple online character designer available HERE. It is only a prototype, it does not contain many pieces yet but it can already generat

...

Book is updated

Now our book "Web Cartoon Maker: A Fun Way to Learn C++" is fully in synch with WCM 1.5! It is available for download and online reading HERE.

...

Web Cartoon Maker 1.5 is here!

Web Cartoon Maker 1.5 is finally here! You can download it HERE! Here is what was updated in version 1.5: Web Cartoon Maker Desktop Edition is now fully standal

...

read more news...


Poll