Tuesday, October 06, 2009

The "conio.h" Problems ::

Well, to be frank, i dont have a good internet connection that i can always go to any one of the it discussion forums and clear my programming doubts, instead i am a kind of lazy person, so i always use the 'default' thing, i mean google, and after all, i assume that the problem which i am facing now would have been really faced by someone or the other while he was a newbie in programming. And fortunately, my assumption always goes correct. That's something good.

Anyways, when i switched myself from Boroland C++ to the Dev version, the biggest problem i faced was of the conio.h header file, someone who is just aware of programming will surely know what exactly i am talking about. This header is just a part of the boroland thing and is never a standard one, so if you want to use one, you must either download it or just use its replacements:

for
clrscr();

you can use
system("cls");

and for
getch();



you can use
std::cin.get();
although you may not feel much comfortable with the getch replacement, clrscr replacement will help you in the same way as did the original command.
enjoy..


For more information regarding this thing, this is the place:

http://www.bloodshed.net/dev/faq.html
http://forums.devshed.com/c-programming-42/lib-conio-o-missing-dev-c-4-9-9-0t-184436.html
http://www.daniweb.com/forums/thread11811.html#


THE GOTO COMMAND GUIDE::

int main()
{
char choice;

top: // goto label

cout << "Hello World!" <<>

cout << "Do again? (y/n)" <<>> choice;
cout <<>

if (choice == 'y')
goto top; // goto statement

return 0;
}

There's a religious battle amongst computer scientists regarding the use of the goto statement. Some say yes, some say no -- it is possible that the use of gotos can make code unbelievably difficult to read. The term spaghetti junction is used to describe confusing code that is written with goto statements. I won't say that I'm for or against it. I use it sparingly and I use it when I see that it is fit to do so.

Well the decision is urs, but this is it...

No comments: