I have Ambigous error in my code both variables are global and one is a two dimensional array and the other is enum , what is wrong , i could post the whole code if it's not clear enough
The Question was:
(Turtle Graphics) The Logo language, which is popular among elementary school children, made the concept of turtle graphics famous. Imagine a mechanical turtle that walks around the room under the control of a C++ program. The turtle holds a pen in one of two positions, up or down. While the pen is down, the turtle traces out shapes as it moves; while the pen is up, the turtle moves about freely without writing anything. In this problem, you’ll simulate the operation of the turtle and create a computerized sketchpad as well.
Use a 20-by-20 array floor that is initialized to false. Read commands from an array that contains them. Keep track of the current position of the turtle at all times and whether the pen is currently up or down. Assume that the turtle always starts at position (0, 0) of the floor with its pen up. The set of turtle commands your program must process are shown in Fig. 7.27.
You shouldnt use std as a global namespace because of things like this.
you could solve the problem by renaming rightright1 or something.
or you could remove the namespace and anything that uses it you could just prefix with std::
The reason is left and right are members of std, like if you didnt use the namespace you would need to use std::right.
The ambiguous error is due to the compiler not knowing which instance of right you are calling
Hope this helps :)
edit: its probably best to just not use the namespace, as this will also happen with other directions and i dont even know everything thats inside it so there may be more name conflicts