Hello everyone, and happy new year!
I'm trying to code my own version of Tetris using unmanaged C++, and it has been going ok so far, but my project will now not compile because of some odd syntax error. When trying to initialize my arrays in the Shape.h file, every left curly bracket gives an error.
I have hosted the Visual Studio 2010 project here: Tetris.7z
Thank you for any help. This is probably a simple mistake, as I am new to C++.
10 replies to this topic
#1
Posted 03 January 2011 - 07:47 PM
|
|
|
#2
Posted 03 January 2011 - 09:23 PM
#3
Posted 03 January 2011 - 09:35 PM
didn't work.
#4
Posted 03 January 2011 - 09:37 PM
I can't really test it right now, but try doing the entire thing in one assignment. There shouldn't be any need for dereferencing or indexing.
sudo rm -rf /
#5
Posted 03 January 2011 - 09:51 PM
Why no dereference operators? My variable is of type "pointer", so don't I need to have an asterisk before it if I assign a value to the memory it points to? And since it's a pointer to a pointer to a pointer, don't I need 2 asterisks (considering that I have "[]" which is really just a dereference operator with a shift)?
btw, I tried it anyway and it still gave me errors.
btw, I tried it anyway and it still gave me errors.
Edited by DMK741, 03 January 2011 - 10:26 PM.
#6
Posted 04 January 2011 - 11:33 AM
This works:
int chachacha[][2][4] = {{{1,2,3,4}, {5,6,7,8}}, {{9,10,11,12},{13,14,15,16}}};
sudo rm -rf /
#7
Posted 04 January 2011 - 07:25 PM
dargueta said:
This works:
int chachacha[][2][4] = {{{1,2,3,4}, {5,6,7,8}}, {{9,10,11,12},{13,14,15,16}}};
no it doesn't. I get the same error, along with a new one for not having an index in that first set of brackets.
#8
Posted 04 January 2011 - 07:35 PM
#9
Posted 04 January 2011 - 07:38 PM
Visual Studio is my IDE. idk what the name of the compiler is.
Try messing with pointer arrays like I did. See if you can get anything useful out of that.
Try messing with pointer arrays like I did. See if you can get anything useful out of that.
#10
Posted 04 January 2011 - 07:39 PM
Okay, but it'll have to wait until tomorrow night for me. Not sure about the time difference, though.
sudo rm -rf /
#11
Posted 04 January 2011 - 07:41 PM
that's ok. I appreciate it.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









