Job 6919

Owner
Darian Craciun
Problem
Peculiar Times
Contest
MindCoding 2015 Round 1
Source
1.16KB
Result
Compile error (Non-zero exit status: 1)

Compiler output

prog.cpp:5:12: error: 'char time [7]' redeclared as different kind of symbol
In file included from /usr/include/pthread.h:26:0,
                 from /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr-default.h:41,
                 from /usr/include/c++/4.7/x86_64-linux-gnu/bits/gthr.h:150,
                 from /usr/include/c++/4.7/ext/atomicity.h:34,
                 from /usr/include/c++/4.7/bits/ios_base.h:41,
                 from /usr/include/c++/4.7/ios:43,
                 from /usr/include/c++/4.7/ostream:40,
                 from /usr/include/c++/4.7/iostream:40,
                 from prog.cpp:1:
/usr/include/time.h:186:15: error: previous declaration of 'time_t time(time_t*)'
prog.cpp: In function 'int main()':
prog.cpp:48:27: error: no matching function for call to 'std::basic_istream<char>::getline(time_t (&)(time_t*)throw (), int)'
prog.cpp:48:27: note: candidates are:
In file included from /usr/include/c++/4.7/iostream:41:0,
                 from prog.cpp:1:
/usr/include/c++/4.7/istream:616:5: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::getline(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize, std::basic_istream<_CharT, _Traits>::char_type) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = long int]
/usr/include/c++/4.7/istream:616:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/4.7/istream:425:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::getline(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = long int]
/usr/include/c++/4.7/istream:425:7: note:   no known conversion for argument 1 from 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' to 'std::basic_istream<char>::char_type* {aka char*}'
prog.cpp:49:26: error: cannot convert 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'char*' for argument '1' to 'char* strtok(char*, const char*)'
prog.cpp:56:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
prog.cpp:56:17: error: assignment of function 'time_t time(time_t*)'
prog.cpp:56:17: error: cannot convert 'char' to 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' in assignment

Questions?

Sponsors Gold