views:

57

answers:

1

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 eclipse(helios) using mingw32-g++

+1  A: 

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.

Anup Kalbalia