Hi Razmattaz,
1. Clear the Screen
From the FAQ: use clrscr() to clear the screen.
FAQ No. 12. I am having problems using Borland specific functions such as
clrscr()
Include conio.h to your source, and add C:\Dev-C++\Lib\conio.o to "Further
Object Files" in Project Options (where C:\Dev-C++ is where you installed
Dev-C++).
2. Use Libraries in a C++ Program
a. Study the documentation that comes with the libraries. If there are
examples or demos, study them to see how to use the class libraries.
b. In your own cpp file, write the code that creates the libraries objects
(or as derived class ) and call the member functions or override parent
class's member functions.
c. Include the relevant library's header file in this cpp file. Then in
Project Options, click Load object files and select lib files to add to your
project.
3. Why Separate source files.
a. minimize compile and linking time. The latest project I'm working on
consists of over 25,000 lines of code in 20 separate files.If all these were
in one file, for every change I make, the project has to be recompiled and
re-linked which will take a lot of time. In the case of multiple files, if I
make changes that affects only 1 file, only that file need to be compiled
and linked with the rest of the object code.
b. organize your codes, especially C++ classes. I usually use 1 cpp file and
1 header file for each class. Code maintenance is an important issue so
organizing your source codes is very important.
c. for me, smaller text files are easier to edit. However, you need to use a
text editor that can open multiple files.
Tip: If you use multiple files, you might want to use grep.exe. This program
allows you to search multiple files for key words.
Regards,
Yeoh
~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~
Author of "How to Create an eBook Using Visual C++"
Free Downloads at http://www.yeohhs.com
ICT eBooks by Yeoh HS
~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~
----- Original Message -----
From: Rashan Jibowu <re...@ho...>
To: <dev...@li...>
Sent: Monday, February 18, 2002 5:03 AM
Subject: [Dev-C++] A Couple of Questions
> Hey Fellow Dev C++ Users:
>
> I have a couple of questions. Perhaps you can help me with them.
>
> 1. How do I clear the screen (MS-DOS) before each time I run, or re-run a
> program?
>
> 2. How do I use libraries in a C++ program?
>
> 3. Why would a programmer want several separate source files to be
compiled
> into one program? Why not just keep all of the source code in one file?
>
> I look forward to your help,
> ~ Razmattaz
|