Subj : Re: Equivalent in c/c++ to a simple javascript obj. To : netscape.public.mozilla.jseng From : Lau Lei Cheong Date : Sat Oct 23 2004 03:30 pm Try to do it this way: By the above code, you have more or less the same as the following in C/C++: An object named 'myobj' is declared inherits 'obj_base' which has a property 'x' as varient, which have a default value of 11. Then a function 'func1' is added which will display the value of 'x' in the object. Javascript have no concept of private or public, and all variables are not typed, so you can't set anything regarding these properties. "__PPS__" ??? news:723debfe.0410201140.5688fe13@posting.google.com ???... > Hi, > could somebody post a simple c/c++ code (or explain in simple words > which api needed) required to declare a js class, so that this class > would be predeclared (like Array) > for example simple js code: > function MyClass(){ > this.x; //public member; > var y; //private member; > z; //static member; > } > What is the equivalent c/c++ code? > basicly each of the members might be a function, object, int etc, but > for a simple example int (JS_Int or whatever) is ok. > > PS. I could execute a few strings of js code to make such a class > declared, but I would like to know what is the code to make it in > c/c++. > > > Thanks .