Topic: Newbie questions...


Author: alsu@uclink.berkeley.edu (Alan Su)
Date: 23 Feb 1993 03:08:41 GMT
Raw View
Anyone out there using Turbo C++ (ver 3.0 I think) I'd appreciate it if you
could take a look at these questions:

(1) Is there a way to call DOS commands from within a C++ program?  I've
tried everything I know...like using system("<command>");.  However, nothing
seems to work.  I don't want to do anything fancy, just copy a file to
another name...*without* having to do something stupid like open two file
streams and copy char by char...

(2) Is there a way to have *one* file stream, open it, scan for a certain
part of the file, *insert* some stuff, and then just close the file with the
text inserted?  Essentially, I want to have a file with an eight char string
on the front of each line.  If I need to insert a new line, I want the file
to remain sorted.  Is this possible?  (I'm sure it is, I guess what I'm
really asking is is there a conventional way to do this, or do I just try to
think up a hack?)

Thanks...
--
-alan su
-alsu@uclink.berkeley.edu