variable declarations

This is a discussion on variable declarations within the C++ Programming forums, part of the General Programming Boards category; Hello, I have been working on this stuff for one hour every day for the past few days and i ...

  1. #1
    K&J
    K&J is offline
    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,267
    "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, 04:31 PM
  2. Replies: 10
    Last Post: 09-27-2005, 01:49 PM
  3. Replies: 2
    Last Post: 04-12-2004, 02:37 AM
  4. write Variable and open Variable and get Information
    By cyberbjorn in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2004, 02: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21