Skip to content

Instantly share code, notes, and snippets.

@MasazI
Created May 22, 2015 07:50
Show Gist options
  • Save MasazI/22f5583f8a39f0fd9015 to your computer and use it in GitHub Desktop.
Save MasazI/22f5583f8a39f0fd9015 to your computer and use it in GitHub Desktop.
override_keyword.cpp
//
// override_keyword.cpp
// CplusplusPractice
//
// Created by masai on 2015/05/22.
// Copyright (c) 2015年 masai. All rights reserved.
//
#include <iostream>
using namespace std;
struct A{
public:
virtual void function() = 0;
};
struct B : A{
public:
void function() override {
cout << "override" << endl;
}
};
int main(int argc, char* argv[]){
B obj;
obj.function();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment