i'm having some problem with the following code:
inputSouce is an abstract class and the rest are derived from it. The definitions for these are elsewhere.
inputSource *irSources; irSources = new irSource();
This is giving me errors. i'm using VS2008.
error C2466: cannot allocate an array of constant size 0
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2040: 'irSources' : 'int ' differs in levels of indirection from 'inputSource *'
error C2440: 'initializing' : cannot convert from 'irSource *' to 'int '
Those are the errors. Could anyone please provide some help as to where i'm going wrong?
inputSource *irOne = new irSource;
This works fine. i'm getting the problem only when i declare an array of pointers and try to allocate memory to them.
Edited 5 Years Ago by myk45: n/a