|
|
вернуться в форумStrange compilation error I have strange problem, my code is compiled well on my home PC (MS VC++ 2010 also), but the same code getting compilation error on Timus. Let me present here a fragment of my code (All problem-related part was expunged, only variable declaration-initialization and input remained). This is also a compilable code on my PC. Can you consider it please. Thanks in advance. #pragma comment(linker, "/STACK:5000000") #include <iostream> using namespace std; int main() { char tmp, or[250001], samp[750002]; int N, z[750002]; memset(&z[0], 0, 750002*4); scanf("%i", &N); scanf("%c", &tmp); cin.getline(or, 250001); cin.getline(samp, 750002); return 0; } Code above gives CE on Timus: 8002b36b-0800-4fc8-aa2b-53e6cb233ddd 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(7) : error C2059: syntax error : '||' 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2143: syntax error : missing ')' before '||' 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2661: 'std::basic_istream<_Elem,_Traits>::getline' : no overloaded function takes 0 arguments with [ _Elem=char, _Traits=std::char_traits<char> ] 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2059: syntax error : ',' 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2059: syntax error : ')' 8002b36b-0800-4fc8-aa2b-53e6cb233ddd(13) : error C2065: 'samp' : undeclared identifier Re: Strange compilation error try rename array "or", I think it can resolve problem Re: Strange compilation error Thanks, the idea of renaming really worked! |
|
|