Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Include proper headers, guys.In Reply To:太奇怪了,C++AC,G++却CE。原因是:'scanf' was not declared in this scope'。以前从没遇到过这种情况~难道G++不能直接用scanf吗? Posted by:new_begin at 2009-05-07 22:14:18 There is absolutely no gauarantee that "#include <iostream>" or simply nothing will get you printf/scanf. Only "#include <cstdio>" will. So it is with memcpy/memset, do "#include <cstring>", not nothing, not "<memory.h>", not "<mem.h>", not anything else. I don't know where on earth did you come up with the idea of using a function from the standard library with including a proper header. Even if that works for now, it can fail in the future. Don't do that. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator