C/Creating a text editor using C or C++
Expert: Prince M. Premnath - 1/20/2007
QuestionDear Mr. Premnath
My objective is to create a text editor using either C or C++, however I am restricted from using a GUI editor so no VC++ etc.
I've done some research and came across a UNIX text editor called PICO and that is exactly how i wanted my text editor to be.
Now the question is where do i start? Is it better using C or C++, Which books should I be reading, should i be reading a computer graphics books, will that help?
Hopefully you can guide me into the right direction.
Cheers,
Shivek Sachdev
AnswerDear Shivek Sachdev!
Of course! its a bit difficult task to develop a full fledged text editor ! , You are restricted to use Visual editor ! ( may be you are restricted to use the sophisticated tools such as MFC / Other supportive functions provided by Microsoft Visual C++ ) But your choice is to develop a text editor from a Text mode environment ( Turbo C/C++ will be the better choice to perform the task!)
1. You have to be familiar with all the functions of a real TEXT mode Text editor ( My advice is its better and easy to create a TEXT mode text editor than graphics mode text editor , because graphics mode text editor is too complex to develop ) ,
2. The library functions given by Turbo C/C++ is not well suit for your work to be done , so i recommend you to create your own functions to handle operations like screen handling ( includes , Menu handling , key board event handling , file handling and so on ..)
3. Use your own ideas to integrate all these components ( Functionally ) as a working tool .
4. Use trial and error ( will be the best ) method to de bug your program until it runs correct !
5. Its good to refer some real time codes to understand the problem so i wish to suggest you a good book on Projects using C .
Book name : Projects in C
Author : Yashavanth Kanethkar
Price : 300.
Publications : BPB
in that book you can get the complete code for a real text editor and also it explains all the concepts in developing a text editor please refer that !
All the best !
Regards !
Prince M. Premnath