-
uhh prob w/ code
Darnit!!!
For some reason it goes ahead and skips the amount of times its supposed to loop. Heres the code. Try your best to reply as fast as you can!!
Code
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
int main()
{
int time = 0;
char name[500];
int times;
clrscr();
cout<<"First type a sentence>";
cin>>name[500];
cout<<"Now type the number of times you want your sentence to appear>";
cin>>times; //It just aint readin dis
cout<<"Good, now press a key and sit back.......";
getch();
clrscr();
while (time != times)
{
time = time + 1;
int x = rand() % 80;
int y = rand() % 24;
gotoxy(x, y);
cout<<name;
}
getch();
return 0;
}
please help me
-
Umm, this is just a guess, but I think you might need to replace this line...
cin>>name[500];
with this...
cin>>name;
If that doesn't work, try the C++ board.
-
Here is no error with loop. Loop is working perfectly.
It's because of
{
gotoxy() ... and
int x = rand() % 80; /**/
int y = rand() % 24; /**/
}
and this receives a word from keyboard.
cin>>name[100] ;
What did you want to with gotoxy().. ?
-
lol, i fixed it, here is the link if you wanna see:
http://www.angelfire.com/ab7/echat/NEATO.EXE
if dat dont work, try
http://www.angelfire.com/ab7/echat/hey.htm
on the second page has the link to download, the first one is the download, i dont know if the link for the download is good but you can see for yourself
-
well, first and second link dont work. heres the real link:
http://www.angelfire.com/ab7/echat/hey
-
darnit, that link dont work, you have to copy paste the link into your address bar if you wanna goto it