When I compile this I get warning: ISO C++ forbids zero-size array 'a' although I am using the 2003 standard.
You have declared a zero size array in the class therefore the class has no data and is zero-sized. Since the array has members it appears that the compiler (mine at least) does not automatically make sure it's size is non-zero, which is normally required to ensure all objects have a different memory address which is a requirement of the standard.
Declare an array of these and the all have the same address, this appears to be non-conforming, however since you have done something that is forbidden I guess that is not unexpected, I'm slightly surprised that it isn't an error.
Many compilers have an "extension" to allow for zero-size arrays, I don't understand why, but they do. According to standard, this code should not compile. And those compilers that implement this zero-size array extension, end up producing a class with size of 0, as a quirk. In my opinion, this extension should not exist, but it does.
Supporting void main() is acceptable in the sense that the compiler can just silently insert an implicit int return value of 0, and it's all the same.
Allowing zero-sized arrays implies that some objects can be a size of 0, which violates some core assumptions in the C++ memory model. I see it as much more brazen than most other extentions that generally just slightly bend a few corner-cases of the standard or allow for some older syntax traditions.
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...