- Joined
- 14 Apr 2004
- Posts
- 11,888
- Location
- UK
Care to elaborate?Ladforce said:its not included in the if statement as its not indented. you should encapsulate anything you want in if statements in braces to prevent ambiguity. see if that helps.
Care to elaborate?Ladforce said:its not included in the if statement as its not indented. you should encapsulate anything you want in if statements in braces to prevent ambiguity. see if that helps.
if (! (( dy == 0) && (dx == 0)))
grid[dy][dx] = SWEET;
if (! (( dy == 0) && (dx == 0)))
{
grid[dy][dx] = SWEET;
}
1>.\Assigment 2.cpp(11) : warning C4653: compiler option 'Optimizations (one or more of /Oawstgp[y]) or debug checks (one or more of /GZ, /RTCcsu)' inconsistent with precompiled header; current command-line option ignored
1>.\Assigment 2.cpp(11) : warning C4652: compiler option 'C++ Exception Handling Unwinding' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
1>.\Assigment 2.cpp(11) : error C2855: command-line option '/clr' inconsistent with precompiled header
1>.\Assigment 2.cpp(11) : error C2855: command-line option '/clr : pure' inconsistent with precompiled header
1>.\Assigment 2.cpp(11) : error C2855: command-line option '/Gm' inconsistent with precompiled header
1>.\Assigment 2.cpp(11) : warning C4651: '/D__MSVC_RUNTIME_CHECKS' specified for precompiled header but not for current compile
1>.\Assigment 2.cpp(11) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Could you explain what you mean when you say that 'everything in the file has a type'?Ladforce said:ok change the comom runtime support back. after building it again go through each of the errors and make sure that everything in that file has a type.
1>.\Assigment 2.cpp(3) : warning C4653: compiler option 'Optimizations (one or more of /Oawstgp[y]) or debug checks (one or more of /GZ, /RTCcsu)' inconsistent with precompiled header; current command-line option ignored
1>.\Assigment 2.cpp(3) : warning C4652: compiler option 'C++ Exception Handling Unwinding' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
1>.\Assigment 2.cpp(3) : error C2855: command-line option '/clr' inconsistent with precompiled header
1>.\Assigment 2.cpp(3) : error C2855: command-line option '/clr:pure' inconsistent with precompiled header
1>.\Assigment 2.cpp(3) : error C2855: command-line option '/Gm' inconsistent with precompiled header
1>.\Assigment 2.cpp(3) : warning C4651: '/D__MSVC_RUNTIME_CHECKS' specified for precompiled header but not for current compile
1>.\Assigment 2.cpp(3) : fatal error C1903: unable to recover from previous error(s); stopping compilation
.
./PHP]
In a nutshell, I have to do it to the speicfication given in the skeleton. It's also how I've been taught. It's not matter of go away and do it, we have adopt what's been given to us.Shoseki said:Sometimes I don't understand other peoples' C++ code or habits at all. Why do you have "prototypes" in the main, and not before the main? Why are you using compiler macro "defines" instead of const static variables?
You are also doing some weird things with those arrays. You are passing by value the array into a function, and then manipulating the array, does that even update the original array? I'd expect it to if you passed by reference (using &) or by pointer.
Lots of things I don't understand about your code...
EDIT : Instead of storing all of your game items into a single array, why not create a few simple structs (one for a position, then one for each type of game item with position, character to be displayed, etc etc) and recompose the final drawing grid each frame. You could then have a vector<fruit> for example and have as many as you wanted on screen, detect collision against game objects rather than a grid etc etc.
Shoseki said:Sometimes I don't understand other peoples' C++ code or habits at all. Why do you have "prototypes" in the main, and not before the main? Why are you using compiler macro "defines" instead of const static variables?
azteched said:Because it seems that often C++ is taught as "C with classes", and not a properly separate language with a very different approach to many things.
C++ is much more sane and fun when you use it right![]()