

A file pointer is used to open and read the file. In the above program, we have a text file “new.txt”. Let’s say we have “new.txt” file with the following content − 0,hell!o

Here is an example to clear the console in C language, Q) write a program to calculate the area of circle, radius4.5. Here is the syntax to clear the console in C language, clrscr() There are some other methods too like system(“cls”) and system(“clear”) and these are declared in “stdlib.h” header file. It clears the screen as function invokes. This command creates another window in the current background color and limits the use of gotoxy() within that window (although creating a new window will again reset gotoxy ).There are several methods to clear the console or output screen and one of them is clrscr() function.
includeWith our present techniques we wont be able to make it much colorful but still colors are always better.įor our new colored menu I would like to introduce a new command called window(). Write a menu driven program that depicts the working of a library. The menu now we have is showing us the selected item but it is dull and lack’s colors. Now a bit of coding manipulations :Ĭode for making a menu (without graphic interface) :Ĭhar* menu_items = //This is for wrapping up The double arrows show the direction: with cin > points to the variable in which the input should be stored.


What happens when we have a menu and we want the current item to look like it’s selected, the special emphasis is brought about by a different color. What do we actually do to create a graphical interface ? We create colored illusions which make it seem that the interface is interactive. This is no standard header file (and there is a specific reason to it too) but helps in creating Better interface for the USER. What I really mean by saying old is that a compiler supporting. This post is specially for those poor students who still have to use older compilers (Like Turbo C++).
