/ Vijos /

记录详情

Compile Error

foo.cpp: In member function 'Matrix& Matrix::operator=(const Matrix&) const':
foo.cpp:21:74: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
     Matrix& operator=(const Matrix& b)const{memcpy(ele, b.ele, sizeof ele); return *this;}/* operator= */
                                                                          ^
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstring:42:0,
                 from foo.cpp:11:
c:\tdm-gcc-32\include\string.h:38:40: error:   initializing argument 1 of 'void* memcpy(void*, const void*, size_t)' [-fpermissive]
 _CRTIMP void* __cdecl __MINGW_NOTHROW  memcpy (void*, const void*, size_t);
                                        ^
foo.cpp:21:85: error: invalid initialization of reference of type 'Matrix&' from expression of type 'const Matrix'
     Matrix& operator=(const Matrix& b)const{memcpy(ele, b.ele, sizeof ele); return *this;}/* operator= */
                                                                                     ^
foo.cpp: In function 'int main()':
foo.cpp:67:35: warning: unknown conversion type character 'l' in format [-Wformat=]
     scanf("%lld%lld%d", &n, &K, &p);
                                   ^
foo.cpp:67:35: warning: unknown conversion type character 'l' in format [-Wformat=]
foo.cpp:67:35: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
foo.cpp:67:35: warning: too many arguments for format [-Wformat-extra-args]
foo.cpp: In member function 'Matrix& Matrix::operator=(const Matrix&) const':
foo.cpp:21:90: warning: control reaches end of non-void function [-Wreturn-type]
     Matrix& operator=(const Matrix& b)const{memcpy(ele, b.ele, sizeof ele); return *this;}/* operator= */
                                                                                          ^

信息

递交者
类型
递交
题目
P1817 兔农
语言
C++
递交时间
2015-12-21 11:53:13
评测时间
2015-12-21 11:53:14
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes