Thread: Bitwise

  1. #1
    Registered User
    Join Date
    Feb 2015
    Posts
    5

    Bitwise

    Can somebody distinguish for me character constant and string constant giving examples

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Sure. I guess you mean "literal" when you say "constant".

    A character literal is a single character( or more for escape sequences ) surrounded by single quotes, like this:
    Code:
    'x' // The character 'x'
    '\n' // The newline character
    A string literal is a sequence of characters( including blanks ) surrounded by double quotes, like this:
    Code:
    "This is a string"
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bitwise more than 8? or less than 8?
    By tennisstar in forum C++ Programming
    Replies: 5
    Last Post: 12-06-2012, 07:05 AM
  2. Bitwise And
    By Alan Gott in forum C Programming
    Replies: 21
    Last Post: 11-22-2011, 03:09 PM
  3. Help with bitwise AND
    By tehjojo in forum C Programming
    Replies: 1
    Last Post: 04-03-2010, 02:23 PM
  4. Bitwise 'and' vs '=='
    By Ducky in forum Windows Programming
    Replies: 4
    Last Post: 07-27-2009, 12:37 PM
  5. Bitwise OR
    By tinkerbell20 in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2005, 02:23 AM