Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Include proper headers, guys.

Posted by frkstyc at 2009-05-08 12:35:31 on Problem 2777
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator