473,387 Members | 1,721 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,387 software developers and data experts.

call base() wrong, why?

Hi,

I have a managed c++ class:

public __gc class MyCpp {
public: MyCpp(){}
}

now I derive one in c#

public class MyCS : MyCpp
{
public MyCS()
{
base();
}

copiler complain base();, why?

Thanks
}

Nov 16 '05 #1
1 959
The syntax is

public MyCS() : base()
{
}

"Fei Li" <Fe***@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
Hi,

I have a managed c++ class:

public __gc class MyCpp {
public: MyCpp(){}
}

now I derive one in c#

public class MyCS : MyCpp
{
public MyCS()
{
base();
}

copiler complain base();, why?

Thanks
}

Nov 16 '05 #2

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

Similar topics

2
by: DreamTV | last post by:
BlankHi, I am C# newbie , I have a class that inherit another class and I want to call constructor of base class I use: base(parameter)... like this but it doesn't work . Need some help....
15
by: jon | last post by:
How can I call a base interface method? class ThirdPartyClass :IDisposable { //I can not modify this class void IDisposable.Dispose() { Console.WriteLine( "ThirdPartyClass Dispose" ); } } ...
2
by: Ryan Liu | last post by:
Hi, There is a method Test() implemented in base class and override in subclass. In base class itself, how to make sure this.Test() will just call implementation in base class only? ...
2
by: Kevin Frey | last post by:
In a derived class I am trying to redefine the implementation of a interface method defined in a base class - the base class interface method was not declared virtual. I have yet to actually...
5
by: desktop | last post by:
I am reading a text that says: "The derived-class constructor initializer names its base-class followed by a (possibly empty) list of arguments. These arguments are the initial values to use in...
2
by: rsdev | last post by:
I've been reading up on delegates and BubbleEvents but this doesn't seem to be the answer to my simple problem. I have a method in my base class which I would like to call from a dynamically...
11
by: Rahul | last post by:
Hi Everyone, While working with Java, i came across super() which passes values to base class constructor from derived class constructor. I was wondering if this could be implemented in c++ by...
16
by: iskhan | last post by:
Scenario Base Class A and its Sub Classes are B, C, D, E, F Every class have a method B_Menu(), C_Menu(), D_Menu(), E_Menu(), F_Menu() respectively. And following Search_Form...
1
by: omran11 | last post by:
How can i call base class constructor? plz explain it to me
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.