473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Strange class definition

I am new to C++ programming, can somebody explain what is this
me_xx is it a type name or instantiation of class Final. And also
how to use me_xx ?
struct IViewObjectEx
{

public:
void solv()
{
}

};

class XViewObject : public IViewObjectEx {

public:
virtual void Draw()=0;

};

class Final: public XViewObject
{
public :
void Draw(){
cout <<"Drawing thru Draw()"<<endl;
}

} me_xx;

int main(){
Final pre;
}

Thanks in advance,
Seema

Mar 9 '06 #1
1 1654
seema wrote:
I am new to C++ programming, can somebody explain what is this
me_xx is it a type name or instantiation of class Final. And also
how to use me_xx ?
It's an instance. It's like this: C++ allows to define a class with or
without declaring something in the same statement. In actuality those
are two separate grammar constructs, IIRC, but they look very similar.

IOW, you can write

struct A {}; // class definition

or

struct A {} a; // class definition _and_ an object declaration

Use 'me_xx' just like you would any other object of type 'Final'.
struct IViewObjectEx
{

public:
void solv()
{
}

};

class XViewObject : public IViewObjectEx {

public:
virtual void Draw()=0;

};

class Final: public XViewObject
{
public :
void Draw(){
cout <<"Drawing thru Draw()"<<endl;
}

} me_xx;

int main(){
Final pre;
}

Thanks in advance,
Seema


V
--
Please remove capital As from my address when replying by mail
Mar 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Moshe | last post by:
Page with a <form> action calls ASP page. The ASP page has the following structure <%@ LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Option Explicit %> <% Server.ScriptTimeOut=100 With Response...
4
by: BCC | last post by:
Given this test code: ..h file -------------- #include <iostream> #include <string> class CContainer { public: typedef std::string::size_type size_type; static const size_type npos2 =...
3
by: CHRISTOF WARLICH | last post by:
Hi, the following few lines of code are showing a quite strange and unexpected behaviour of namespaces that makes me worry wheater I should rely on namespaces in the future at all. The...
2
by: Tony Johansson | last post by:
Hello! I have two very small classes(Head_1 and Head_2) see below and a very small main. I have run into a very strange problem. This program doesn't compile but if I replace the string...
2
by: Paul Drummond | last post by:
Hi all, I am developing software for Linux Redhat9 and I have noticed some very strange behaviour when throwing exceptions within a shared library. All our exceptions are derived from...
1
by: Zoury | last post by:
Hi there! :O) I have a WebService that contains the following struct definition. this struct is defined right after the WebService class, ie : //*** namespace mynamespace { public class...
2
by: shaun roe | last post by:
Following up from my earlier post, where I pursued the line I outlined. Here is the MYFunc class implementation: MyFunc::MyFunc(int i):m_i(i){ ostringstream os; os<<"This number is "<<m_i;...
7
by: Paul Czubilinski | last post by:
Hello, I have a problem with code like this (PHP 5.1.4): fila A.php: ======= include(B.php); class document extends obj { .........
4
by: tony | last post by:
Hello! My question is about calling this method CollectData below but I get a compile error that I shouldn't have because the type parameter is correct. The compile error is the following:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.