Too Few Arguments To Function

Pages: 12
Section 2.14.5 String literals

8 Ordinary string literals and UTF-8 string literals are also referred to as narrow string literals. A narrow string literal has type “array of n const char”, where n is the size of the string as defined below, and has static storage duration (3.7).


As Operator and "Add" occupy different memory then the comparison

if (Operator == "Add"){

is well-specified and is always equal to false.
Last edited on
closed account (Dy7SLyTq)
thanks my mistake
An unspecified behaviour is the following

if ( "Add" == "Add" )

This can be either equal to true or to false depending on compiler options. That is the compiler can store these two string literals as one string luteral or allocate two separate extents to store them separatly.
Last edited on
closed account (zb0S216C)
vlad from moscow wrote:
"That is the compiler can store these two string literals as one string luteral or allocate two separate extents to store them separatly."

I've already pointed that out.

Wazzak
Topic archived. No new replies allowed.
Pages: 12