the first error you should run into is an error about cout being undeclared, like prelude said... try this:
Code:
#include <iostream>
#include <conio.h>
using namespace std; //not the best way, but good enough for beginners
int main(int argc,char *argv[])
{
char start;
while(start!='A')
{
cout<<"CORN ON THE COB!"<<endl; //
cout<<"Press A to clear the text...";
}
clrscr();
return 0;
}
and to answer your question about a good way to clear the screen... as far as i know, there is no good way to clear the screen, and clrscr() isn't supported by all compilers... it looks like your compiler doesn't support it
I have a question about the clrscr() function... why does conio.h have a prototype for it if it's never defined... a short clip from conio.h:
Code:
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
#define BLINK 0
typedef enum
{
BLACK,
BLUE,
GREEN,
CYAN,
RED,
MAGENTA,
BROWN,
LIGHTGRAY,
DARKGRAY,
LIGHTBLUE,
LIGHTGREEN,
LIGHTCYAN,
LIGHTRED,
LIGHTMAGENTA,
YELLOW,
WHITE
} COLORS;
#define cgets _cgets
#define cprintf _cprintf
#define cputs _cputs
#define cscanf _cscanf
#define ScreenClear clrscr
/* blinkvideo */
void clreol (void);
void clrscr (void);
int _conio_gettext (int left, int top, int right, int bottom,
char *str);
/* _conio_kbhit */
void delline (void);
/* gettextinfo */
void gotoxy(int x, int y);
/*
the compiler still complains about it not being there... is there something about headers i'm missing here?