Difference between undefined, unspecified, and implementation-defined behavior in C and C++?

Abhinanda Shri
Updated on 30-Jul-2019 22:30:21

648 Views

Undefined behavior is simply behavior that is not defined by the C++ specification. For example, if you have multiple unary increment/decrement operations in an expression like i++ + ++i, they result in behavior that is not defined. This is simply due to the fact that some language constructs are syntactically valid but you can't predict the behavior when the code is run. Another example is the expression: u = (u++);Implementation-defined behavior is behavior unspecified by the specification and left for the implementor to decide and document how the choice is made. In this case, the choice that is made must ... Read More

What does the bitwise left shift operator do in Java?

Monica Mona
Updated on 30-Jul-2019 22:30:21

326 Views

The left operand value is moved left by the number of bits specified by the right operand.Example: A

What does the bitwise right shift operator do in Java?

Lakshmi Srinivas
Updated on 30-Jul-2019 22:30:21

435 Views

The left operand value is moved right by the number of bits specified by the right operand.Example: A >> 2 = 15 means 1111.

What happens if the output of MySQL TIMEDIFF() function surpass the range value of TIME field?

Ankitha Reddy
Updated on 30-Jul-2019 22:30:21

302 Views

As we know that the range of TIME field in MySQL is ‘-838:59:59’ to ‘838:59:59’. Now, if TIMEDIFF() function’s output surpasses this range then MySQL will return either ‘-838:59:59’ or ‘838:59:59’ depends upon the values of the argument. Example mysql> Select TIMEDIFF('2017-09-01 03:05:45', '2017-10-22 03:05:45')AS 'Out of Range TIME Difference'; +------------------------------+ | Out of Range TIME Difference | +------------------------------+ | -838:59:59 | +------------------------------+ 1 row in set, 1 warning (0.00 sec) mysql> Select TIMEDIFF('2017-10-22 04:05:45', '2017-09-01 03:05:45')AS 'Out of Range ... Read More

What are the complexities MySQL joins involve?

Giri Raju
Updated on 30-Jul-2019 22:30:21

274 Views

Actually, in simple words, we can say that a join between tables is an extension of a single-table SELECT statement but it involves the additional complexities:Need to specify all the tablesWe need to specify all the tables in FROM clause which are involved in the join. It is in contrast with the SELECT statement in which only one table name is necessary.Need to specify the matching conditionsWe just need to specify the matching conditions based on which a join matches the records in one table with a record in another table. The conditions often are given in the WHERE clause, ... Read More

What is JAVA_HOME variable in Java Environment?

Anjana
Updated on 30-Jul-2019 22:30:21

559 Views

JAVA_HOME refers to jdk/bin directory. It is used by a java based application.

What is the difference between the != and <> operators in Python?

Malhar Lathkar
Updated on 30-Jul-2019 22:30:21

351 Views

In Python 2.x, both != and operators are available to check if two operands are not equal. Both return true if operands are not equal and false if they are equal.In Python 3.x, operator has been deprecated.

How can we count a number of unique values in a column in MySQL table?

Ankitha Reddy
Updated on 30-Jul-2019 22:30:21

361 Views

By using DISTINCT keyword along with column name as the argument of COUNT() function we can count the number of unique values in a column. The syntax is as follows − SELECT COUNT(DISTINCT Col_name) FROM table_name; Example Suppose we have the following table mysql> Select * from tender; +----------+--------------+--------------+-------+ | clientid | client_Fname | Client_Lname | value | +----------+--------------+--------------+-------+ | 100 | Mohan | Kumar | 60000 | | 101 | Sohan ... Read More

How to set Java Path in Linux OS?

Manikanth Mani
Updated on 30-Jul-2019 22:30:21

494 Views

Environment variable PATH should be set to point to where the Java binaries have been installed. Refer to your shell documentation if you have trouble doing this.Example, if you use bash as your shell, then you would add the following line to the end of your '.bashrc: export PATH=/path/to/java:$PATH'

Difference between C++ string constants and character constants

karthikeya Boyini
Updated on 30-Jul-2019 22:30:21

967 Views

In C++, a character in single quotes is a character literal. It's of type char. For example, 'a' is of type char with a value 97 on an ASCII based system.A character or a string of characters together in double quotes represent a string literal. It's of type const char[] and refers to an array of size length of string + 1. That extra character is there for marking the string's ending.String literals can be arbitrarily long, such as "abcdefg". Character literals almost always contain just a single character. When these are being printed, string literals are printed till the ... Read More

Advertisements