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;
}

Comments

  1. compile it on Turbo c;
    u will get an .exe file....
    if u do include all header files u might be able to run it on all platforms/os

    ReplyDelete

Post a Comment

Popular posts from this blog

NASM: program to find largest number from an array of 32-bit numbers(hard-coded)

Rules for drawing a FLOWCHART