codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  c++ student in desperate need of help  Dave256000 at 18:04 on Wednesday, February 28, 2007
 

Using the skeleton below

#include <unistd.h> // read/write
#include <sys/file.h> // open/close values
#include <string.h> // strlen
int main( int argc, char *argv[], char *env[] )
{
// C++ or C code
}


Write a C++ application to write the message Hello Brighton to the
terminal using the Unix/Linux API only. The output should be of the form:


#include <unistd.h> //read/write
#include <sys/file.h> //open/close values
#include <string.h> //strlen

int main( int argc, char* argv[], char* env[] )
{
for ( int i=1; i<argc; i++ )
{
write( 1, argv, strlen( argv ) );
write( 1, " ", 1 );
}
write( 1, "Hello Brighton" , 14 );
}


ok, i managed to get the last question, could someone please give me an idea how to do the following?:
same skeleton is used.


Write a C++ application myrm that removes (deletes) files passed as command line
argument. Use only the Unix/Linux API in your program, do not use standard library
functions.



Hint:

echo > File1
./myrm File1





I've gone through several linux api tutorials and am fairly competent with c++. I would greatly appreciate any help or advice.



Dave









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem
•  Re: import contacts of msn/yahoo
•  Cookies and Threads C++
•  right justify a background in a table?
•  Help with Loop (C++/MFC)
•  Help with Loop (C++/MFC)


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007