This was my understanding; and hence my original question.
Although, as above, when trying to create the object from the class in another file, it still can't see it? On the other hand; it doesn't allow for redefinition either?
ie
class sample_class
{
};void setup()
{
}void loop()
{}
class sample_class
{
};
Throws a 'redefinition of 'class sample_class'' error, as expected. :~
I've worked around the solution through the use of a .cpp and corresponding header file; but at this point am just curious as to why the code in my original post doesn't work? (Assuming the compiler just appends the tabs onto the principal file).
Is it because the files are appended at the end of the principal file and hence, the compiler attempts to create the object without the class having been defined (or prototyped)?
Thanks again