hey guys.. i have problem compiling this code.. i am new to c++ by the way.
this is my code.
// Project.cpp : Defines the entry point for the console application.
// Doodle Program
#include"stdafx.h"
#include<iostream>
#include<conio.h>
#include<random>
using namespace std;
int main(){
randomize();
cout<<"Doodler! Press I/J/K/M to move, Q to quit"<<endl;
char KeyPressed; // key pressed by user
int x=40; int y=10;
do{
// plot a point
gotoxy(x, y);
cout<<"*";
gotoxy(x, y); // Move blinking curser under current spot
KeyPressed = getch();
if(KeyPressed == "I" || KeyPressed == "i")
y--;
else if(KeyPressed == "T" || KeyPressed == "t")
y++;
else if(KeyPressed == "J" || KeyPressed == "j")
x--;
else if(KeyPressed == "K" || KeyPressed == "k")
x++;
else if(KeyPressed == "Q" || KeyPressed == "q")
;// do nothing
else
cout<<"\a"; // Beep for bad keyword
} while((KeyPressed != 'Q') && (KeyPressed != 'q'));
gotoxy(1, 1); // clear and display new title
clreol();
cout<<"Random stars! Press any key to stop."<<endl;
while(!khhit()){
gotoxy(1+random(60), 2+random(20));
cout<<"* "; // A start and a blank to draw And Erase
}
return(0);
}
so what is wrong on it?? i am using VC++. any help will be highly appreciated!