Answer to Question #165925 in C++ for Jean Claude

Question #165925
  1. a) Compare and contrast systems programming in Windows as against systems programming in
  2. Unix/Linux.    


b) Identify the features of each of these OS platforms that makes it suitable for system

programming.

 

2.     Using the Windows API, Write a C/C++ program to create a file in Windows and write some

text to the file.

 


1
Expert's answer
2021-02-23T04:05:26-0500

Systems programming is the process of writing a software to host or to provide a platform for

other software on a particular system such as phones, computers and embedded systems. In

simple terms any software that make kernel calls can be termed as a system software.

Considering the operating system which is the fundamental software in in both Linux and

Windows.

The kernel

: Both windows and Linux have the core component of the operating system which is

the kernel. However, windows use micro kernel while Linux make use of monolithic kernel.

Hardware and software support

. In terms of software and hardware support, there is a wide

range of software and hardware support for windows due to its large number of users. windows

provide broader driver and hardware support, windows for hardware devices.

Reliability

. The majority of Linux variants are more reliable and can often run for months and

years without needing to be rebooted

// C++ implementation to create a file 
#include <bits/stdc++.h> 
using namespace std; 
  
// Driver code 
int main() 
{ 
    // fstream is Stream class to both 
    // read and write from/to files. 
    // file is object of fstream class 
   fstream file; 
  
   // opening file "Gfg.txt" 
   // in out(write) mode 
   // ios::out Open for output operations. 
   file.open("Gfg.txt",ios::out); 
  
   // If no file is created, then 
   // show the error message. 
   if(!file) 
   { 
       cout<<"Error in creating file!!!"; 
       return 0; 
   } 
  
   cout<<"File created successfully."; 
  
   // closing the file. 
   // The reason you need to call close() 
   // at the end of the loop is that trying 
   // to open a new file without closing the 
   // first file will fail. 
   file.close(); 
  
   return 0; 
} 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment