Hello,
which spezifications / header files are necessary to use the Realview compiler for c++?
I use
#include<stdlib.h> #include<iostream.h>
Class Array { private: int val[19]; public: int max = 2; };
But µVision don't know the word "Class" - is it the wrong spelling or is there a necessary headerfile missing?
best wishes Tina
ok - I only have to change .c into .cpp - that's all? But what's the problem that uvision gets an error, when I write "class"?
The C++-unique keyword "class" does not exists in C, so uVision should complain, if a statement starts with "class" in a C file.
In C, you can declare a variable named class, i.e.
int class;
In older C compilers, you may declare variables with an implicit int data type, writing:
class;
But you will not manage to get a C compiler to like:
class Array { ... };
since that does not mean anything for a C compiler. If "class" was a function name (with an implicit int return type) then it should be followed by a '(' character for the parameter list. If "class" is a variable (of implicit int type) then it should be followed by a comma, a semicolon, a '[' or similar.