Forums - C# Corner

Forum guidelines
Ken H

Ken H

  • 439
  • 358
  • 198.3k

Some confusion of the character constant

Mar 12 2012 7:02 AM
hi all,
   Consider the following problem:
first:

#include
void main()
{
 char ch='\48';
  printf("%c\n",ch);
}
//Why the above code output is 8?

second:

#include
void main()
{
 char *s="\ta\018bc";
 for(;*s!='\0';s++) printf("*");
}
//Why the above code output is 6 *?

thank very much.

Answers (1)

Download Free eBooks

SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.