Hi the program is mostly done, i am trying to compile it and thats when i have problems. I am using Xcode(mac). I just want to know if the code is good, bcoz even if there is no errors, I only have a blanc screen after i run it.
thats the program:
#include <iostream>
using namespace std;
class NonVirtuelle {
int x;
public:
void a() const {}
int b() const { return 1; }
};
class UneVirtuelle {
int x;
public:
virtual void a() const {}
int b() const { return 1; }
};
class DeuxVirtuelles {
int x;
public:
virtual void a() const {}
virtual int b() const { return 1; }
};
int main1() {
cout << "La taille d'un entier: " << sizeof(int) << endl;
cout << "La taille de NonVirtuelle: " << sizeof(NonVirtuelle) << endl;
cout << "La taille d'un pointeur void: " << sizeof(void*) << endl;
cout << "La taille de UneVirtuelle: " << sizeof(UneVirtuelle) << endl;
cout << "La taille de DeuxVirtuelles: " << sizeof(DeuxVirtuelles) << endl;
return 0;
}
In XCode, pressing Apple+Y will run your application in debug mode. If you see nothing apart from the build results window, press Apple+Shift+Y to bring up the debugger window, then click on the console button in the top right of the toolbar. You should see your program's output in there.
Alternatively, open a terminal window and run your app from there. e.g.