#include <iostream>
using namespace std;
class Cls1{
public:
void sameName() {
cout << "I am from Cls 1" << endl;
}
};
class Cls2{
public:
void sameName() {
cout << "I am from Cls 2" << endl;
}
};
int main() {
Cls1 Object;
Object.sameName();
Cls2 Object;
Object.sameName();
return 0;
}
||=== Build: Debug in Main (compiler: GNU GCC Compiler) ===|
C:\Users\user\Desktop\Main\main.cpp||In function
C:\Users\user\Desktop\Main\main.cpp|24|error: conflicting declaration
C:\Users\user\Desktop\Main\main.cpp|21|note: previous declaration as
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
No comments:
Post a Comment