Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to understand char declaration

 
shetal bansal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a doudt regarding char type variables intialization, i.e. how r the following declarations valid?

e.g
char c = '\061';
char c = '\61';

what does the escape character '\' signify?
 
Kedar Dravid
Ranch Hand
Posts: 333
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can use the escape sequence \ddd to specify a character literal by octal value, where each digit d can be any octal digit (0-7). The number of digits nust be 3 or fewer, and the octal value must not exceed \377, that is, only the first 256 characters can be specified with this notation.

e.g.: '\141', '\46'
 
shetal bansal
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic