Thread: variable declarations

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    9

    Question variable declarations

    Hello,
    I have been working on this stuff for one hour every day for the past few days and i still dont get it.
    "if "a" is an int, "b" is a double, and "c" is a char, what is the type of value returned by the expression "c % a", "char(a)", or "int(b)"

    If you can help at all please do I am very desperate for answers!!!

    [COLOR=blue]

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    "c % a",

    %, is the Modulo operator it produces the ramainder of a division , such that 25 % 24 would equal 1,

    a char is actually single byte int , where-as and int is 4 bytes

    "char(a)",

    this converts a to a char,

    or "int(b)"

    this converts b to an int
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. static class variable vs. global variable
    By nadamson6 in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2005, 03:31 PM
  2. Replies: 10
    Last Post: 09-27-2005, 12:49 PM
  3. Replies: 2
    Last Post: 04-12-2004, 01:37 AM
  4. write Variable and open Variable and get Information
    By cyberbjorn in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2004, 01:30 AM
  5. Variable question I can't find answer to
    By joelmon in forum C++ Programming
    Replies: 3
    Last Post: 02-12-2002, 04:11 AM