如何在Child中使用Parent的变量值?

时间:2017-05-26 14:05:40

标签: c++ class

关于第X类

    let loggedIn = self.webView.stringByEvaluatingJavaScript(from: "loggedIn");

    let alertController = UIAlertController(title: "iOScreator", message:
        loggedIn, preferredStyle: UIAlertControllerStyle.alert)
    alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.default,handler: nil))

    self.present(alertController, animated: true, completion: nil)

关于Y班

class X
{
protected:
    int abc=10;
public:
    X() {};
    ~X() {};
    int getABC() { return abc; }
};

我想将类X的变量abc的值放在类Y的变量abc中。

1 个答案:

答案 0 :(得分:0)

您必须在a[i]中存储X的引用。 也许这就是你想要做的事情:

Y
相关问题