OSA:System information c++
#include <iostream>
#include <sys/utsname.h>
using namespace std;
int main(){
struct utsname sysinfo;
uname(&sysinfo);
cout << "System Name: "<<sysinfo.sysname<<endl;
cout << "Host Name: "<<sysinfo.nodename<<endl;
cout << "Release(Kernel) Version: "<<sysinfo.release<<endl;
cout << "Kernel Build Timestamp: "<<sysinfo.version<<endl;
cout << "Machine Arch: "<<sysinfo.machine<<endl;
cout << "Domain Name: "<<sysinfo.domainname<<endl;
return 0;
}
#include <sys/utsname.h>
using namespace std;
int main(){
struct utsname sysinfo;
uname(&sysinfo);
cout << "System Name: "<<sysinfo.sysname<<endl;
cout << "Host Name: "<<sysinfo.nodename<<endl;
cout << "Release(Kernel) Version: "<<sysinfo.release<<endl;
cout << "Kernel Build Timestamp: "<<sysinfo.version<<endl;
cout << "Machine Arch: "<<sysinfo.machine<<endl;
cout << "Domain Name: "<<sysinfo.domainname<<endl;
return 0;
}
compile it on Turbo c;
ReplyDeleteu will get an .exe file....
if u do include all header files u might be able to run it on all platforms/os