Thread: Identify the invalid expression (variables are int or int* and nonzero)

  1. #1
    Registered User
    Join Date
    Mar 2019
    Posts
    9

    Identify the invalid expression (variables are int or int* and nonzero)

    a) a+b-0
    b) c+-a%4
    c) xm6-24
    d) xf3r6+2
    e) all are valid

  2. #2
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,876
    Fact - Beethoven wrote his first symphony in C

  3. #3
    Registered User
    Join Date
    Mar 2019
    Posts
    9
    There aren't any answers in the answer key, please I need this haha. I tried asking anyone I could and even tried it in C but couldn't figure it out.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,750
    That's a pretty ridiculous question as an expression could be valid with an int but invalid with an int*, so is such an expression valid or invalid?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Identify the invalid C expression
    By Danny.Hoshi in forum C Programming
    Replies: 10
    Last Post: 02-28-2015, 01:33 PM
  2. Error: Invalid use of void expression
    By pillaw in forum C Programming
    Replies: 3
    Last Post: 03-16-2014, 10:47 PM
  3. Last nonzero digit.
    By paper1 in forum C++ Programming
    Replies: 2
    Last Post: 10-01-2012, 05:10 AM
  4. invalid use of void expression
    By kittycase in forum C Programming
    Replies: 5
    Last Post: 12-02-2009, 11:21 AM
  5. invalid use of void expression
    By bradleyd in forum C Programming
    Replies: 7
    Last Post: 07-05-2007, 04:09 PM

Tags for this Thread