logo codesdope

In C++ Character is constant or variable?


In c++ , whether the CHARACTER is a variable or a constant? 

  • variable
    - Wajih Wajih


  •    KalyanSrujan

    Hi Sriya,

    In C++ character is a variable

    Variable : Which can be changed.

    Constant : Which can not be changed.

    ex: program



    int main()
        using namespace std;
        char c;
        cout<<"Enter the char before Changing: ";
        cout <<"Thanks for entering the char: "<<c<<endl;
        cout<<"Enter the char after changing: ";
        cout <<"Thanks for entering the char: "<<c;
        return 0;



    • Thank You!!
      - Sriya

Write your answer

Welcome.please sign up.


Welcome.please login.