I\'m trying to declare a C++ variable that takes up zero bytes. Its in a union, and I started with the type as int[0]. I don\'t know if that is actually zero bytes (although
A variable in C++ can never take zero bytes. Every object must have unique address, which is not possible if the size is zero.
By the way,int[0] is illegal in Standard C++. If you're using GCC, compile it with -pedantic option, you will get this warning:
warning: ISO C++ forbids zero-size array 'x' [-pedantic]
Also, the syntax for typedef should be this:
typedef int array[100]; //zero cannot be size - illegal!