Ender
06-07-02, 03:45 PM
Concider this
Hey guys, I havnet posted anything in a LONG while but...
I have this problem with some very basic code:
#include <fstream.h>
#include "apvector.h"
#include <stdlib.h>
#include <conio.h>
void main()
{
int moving=0, l, j;
apvector <char> mover [20];
//fill apvector with dots
for(int c=0; c<20; c++)
{
mover[c]='.';
}
mover[0]='x';
cout<<"Move your 'x'";
system("pause");
moving=getch();
if(moving == 75)
{
for(int k=0; k<20; k++)
{
error--------------> if( mover[k]=='x')
k=l;
}
mover[k]='.';
mover[k-1]='x';
}
if(moving == 77)
{
for(int h=0; h<20; h++)
{
error--------------> if( mover[h] == 'x')
h=j;
}
mover[h]='.';
mover[h+1]='x';
}
for(int d=0; d<19; d++)
{
error----------> cout << mover[d];
}
}
D:\CPrograms\MOver\mover.cpp(33) : error C2676: binary '==' : 'class apvector<char>' does not define this operator or a conversion to a type acceptable to the predefined operator
D:\CPrograms\MOver\mover.cpp(45) : error C2676: binary '==' : 'class apvector<char>' does not define this operator or a conversion to a type acceptable to the predefined operator
D:\CPrograms\MOver\mover.cpp(54) : error C2676: binary '<<' : 'class ostream_withassign' does not define this operator or a conversion to a type acceptable to the predefined operator
I'm just experimenting with this, if anyone has any ideas it would be greatly appreciated!
Hey guys, I havnet posted anything in a LONG while but...
I have this problem with some very basic code:
#include <fstream.h>
#include "apvector.h"
#include <stdlib.h>
#include <conio.h>
void main()
{
int moving=0, l, j;
apvector <char> mover [20];
//fill apvector with dots
for(int c=0; c<20; c++)
{
mover[c]='.';
}
mover[0]='x';
cout<<"Move your 'x'";
system("pause");
moving=getch();
if(moving == 75)
{
for(int k=0; k<20; k++)
{
error--------------> if( mover[k]=='x')
k=l;
}
mover[k]='.';
mover[k-1]='x';
}
if(moving == 77)
{
for(int h=0; h<20; h++)
{
error--------------> if( mover[h] == 'x')
h=j;
}
mover[h]='.';
mover[h+1]='x';
}
for(int d=0; d<19; d++)
{
error----------> cout << mover[d];
}
}
D:\CPrograms\MOver\mover.cpp(33) : error C2676: binary '==' : 'class apvector<char>' does not define this operator or a conversion to a type acceptable to the predefined operator
D:\CPrograms\MOver\mover.cpp(45) : error C2676: binary '==' : 'class apvector<char>' does not define this operator or a conversion to a type acceptable to the predefined operator
D:\CPrograms\MOver\mover.cpp(54) : error C2676: binary '<<' : 'class ostream_withassign' does not define this operator or a conversion to a type acceptable to the predefined operator
I'm just experimenting with this, if anyone has any ideas it would be greatly appreciated!