TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: STEVEN DYCK
from: KEVIN CAMPBELL
date: 1997-06-01 11:29:00
subject: Three questions

 main(){
   char Monster_Name[]="Bear";
   clrscr();
   printf("%s", Monster_Name);
   getch();
   return(0);
 }
That should work. Either that, or declare Monster_Name as a "char *", then 
assign it that value of "Bear". In C, the use of ""s, usually returns a 
pointer to a NULL-terminated string.
 > My next question is how do you use dos commands in C++.  I mean if I
 > wanted to
 > make a program that could show all the files in a certain directory, or
 > make
 > directories, etc. how would I do this?
either system(); or some of the filing commands: unlink(); _dos_findfirst();
 > My last question is this.  How do you save to a seperate file (name of
 > person,
 > age, other information), and how do you retrieve this information in the
 > same
 > program?
fopen();
fputs();
fgets();
fwrite();
fread();
Have Fun - Kev
Kevin Campbell
Sysop of Deimos BBS
E-Mail: Sysop@Deimos.unmanned.co.uk
--- FMail/386 1.02
---------------
* Origin: Mail shipped from Deimos Spaceport (2:259/17)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.