### ShubhamAvasthi's blog

By ShubhamAvasthi, history, 3 months ago, ,

I tested the following code with three different compilers and saw some peculiar results. First of all, I am not sure why the program compiles (no errors with isalpha) indicating that cctype/ctype.h is being automatically included allowing the compilation of the program.

As far as I know and according to cplusplus.com, neither cctype namespace nor ctype.h header file is amongst the automatically included header files for iostream. Also, iostream does not inherit from cctype/ctype.h.

#include <iostream>
using namespace std;

int main()
{
cout<<isalpha('a');
}


On my local machine with MinGW (32 bit), it prints 2.

On Codeforces compiler, it prints 2.

On ideone, it prints 1024.

All the above compilations were done for C++14.

It would be great if someone could share the reason for this behaviour.

• +24

By ShubhamAvasthi, 2 years ago, ,

I am sure that my submission for problem A is correct, but the judge says "Idleness Limit Exceeded". It may be due to some issue with C++17 Diagnostics, which I mistakenly selected during the contest to submit the problem. What should I do now?

UPD: Thank you Reyna for putting it on rejudge.

UPD2: The submission got accepted.