Site icon TestingDocs.com

C Case-Sensitive Programming Language

Overview

C is a case-sensitive programming language. The uppercase letters and lowercase letters in the C language are considered to be different.

C is Case-Sensitive

C is case-sensitive for the identifiers. This means that if we define a variable in lowercase, we cannot refer to it in uppercase. C language treats them as different variables.

C is also case-sensitive for the function names. This means that if we define a function in lowercase, we cannot refer to or invoke the function in uppercase. We can provide two different implementations for the lowercase and uppercase functions.

Example

In this example, we define two variables a and A, and store different values. C considers them as two different variables.

 

 

/**
**********************************
* Program Description:
* C Expressions Demo
* Filename: casesense.c
* C Tutorials - www.TestingDocs.com
*************************************
*/
#include
/* Function Prototypes */
void foo();
void FOO();

int main()
{
    // declare variables
    int a = 7;
    int A = 9;
    /* C is case-sensitive programming
    Language. It considers lowercase letters
    and uppercase letters to be different.
     */
    printf("Lower case a = %d \n",a);
    printf("UPPER case A = %d \n",A);
    foo(); // invoke foo()
    FOO(); // invoke FOO()
    return 0;
} // end main

// dummy function foo (lower case)
void foo(){
    printf("Lower case function foo()\n");
}

// dummy function FOO (UPPER case)
void FOO(){
    printf("UPPER case function FOO()\n");
}


 

Notice that we have provided two different implementations to the functions foo() and FOO(). C language treats both functions to be different.

Exit mobile version