Computer Science Canada need help... |
Author: | ownageprince [ Mon Oct 30, 2006 10:27 pm ] |
Post subject: | need help... |
hey..i was in the dwite.org contest thingy and i solved two problems but when they were sent to them it said that the programs were not executed but they worked perfectly fine on my friends and my laptops.. can some1 pls tell why they did not execute if there is a problem with them.. |
Author: | ownageprince [ Mon Oct 30, 2006 10:28 pm ] |
Post subject: | contd |
oops this is the source code... |
Author: | Tony [ Mon Oct 30, 2006 10:37 pm ] |
Post subject: | |
here's what I get with gcc / g++ Quote: P1.cpp: In function `int main()': P1.cpp:5: error: `nocreate' is not a member of type `std::basic_ios<char, std::char_traits<char> >' your second submission has the same problem Quote: P2.cpp: In function `int main()': P2.cpp:6: error: `nocreate' is not a member of type `std::basic_ios<char, std::char_traits<char> >' |
Author: | wtd [ Mon Oct 30, 2006 11:07 pm ] |
Post subject: | |
The "iostream.h" and "fstream.h" headers are deprecated. |
Author: | ownageprince [ Tue Oct 31, 2006 11:32 pm ] |
Post subject: | |
whoa..could you guys explain a little more pls? i want to get points next time.. |
Author: | ownageprince [ Tue Oct 31, 2006 11:39 pm ] |
Post subject: | |
hang on would that happen because of differences between the compiler that i use and they use? cuz i use the program microsoft visual c++ and i they use gnu complier |
Author: | wtd [ Wed Nov 01, 2006 9:47 am ] |
Post subject: | |
http://www.devx.com/tips/Tip/14544 |
Author: | Tony [ Wed Nov 01, 2006 10:48 am ] |
Post subject: | |
ownageprince wrote: hang on would that happen because of differences between the compiler that i use and they use?
probably not in this case, for the reasons wtd points out. Although I would strongly recommend having a copy of the judge's compiler. You are welcome to develop and test with your tools of choice, but it would be good practice to run a quick test with the official compiler to avoid some quirks that might result. It would be a silly reason to loose points otherwise. |
Author: | wtd [ Wed Nov 01, 2006 10:58 am ] |
Post subject: | |
It is a difference in the compiler. VC++ (especially version 6) includes support for non-standard headers like "iostream.h". GCC supports standard C++. The OP did not write standard C++, so GCC crapped on his code. |
Author: | ownageprince [ Wed Nov 01, 2006 9:12 pm ] |
Post subject: | |
oohh i understand now...thank you very guys ^^ |