This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ question: where does int() come from ?


Following is a simple C++ program:

#include<iostream>

use namespace std;

int main() {
   cout << "int value = " << int('A') << "\n";
}


It outputs the integer value of character 'A'.


Is the int('A') a function call provided by C++ library or the compiler will do the conversion during compilation time ?


Regards,


Mike



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]