开发者

c++ compile error in codechef.com

I am trying to submit the solution of Adding Least Common Multiples(July contest) in codechef.com.

But

After submission I have got an error

/sources/tested.cpp:1: error: expected unqualified-id before numeric constant

what is it mean?

I did not get any error when I compiled in ec开发者_StackOverflow中文版lipse(helios) using mingw32-g++


Can you copy paste your line of code which is causing this error?

This can happen for various reasons.

  1. There can be name collisions wherein you decalare some variable which conflicts with some preprocessor constant.
  2. Passing references to temporary objects as parameters wherein the function expects a reference to some class.
  3. Sometimes it happens that the editors that you use introduce line numbers in the source files and when you copy your code from that editor the line numbers get copied too. I guess this may be a reason in your case. Try uploading your file option rather than pasting your code.

General guidelines to avoid such errors:

  1. All uppercase names are often used for preprocessor macros, which do not respect namespace scopes. Therefore such names should generally be avoided for everything else.

  2. Use GCC for local compilation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜