Good evening guys....
i'm newbie in here and in c++...
while i in the middle of pratice in making program...
i try to make a stack that can check whether the string that user input is palindrome or not.
i'm using visual studio 2010 and get autos error
this is the class declaration
class stack
{
public:
stack();
~stack();
void instack();
void push(char[10]);
void pop();
void copy(char[10]);
void display();
void palin(char[10]);
bool more();
bool isfull();
private:
int max, check, count;
char r[10];
char c[10];
struct t1;
typedef t1 *ptr;
ptr stop;
struct t1
{
char palin[10];
ptr next;
};
ptr head;
};
and here is the code
void stack::pop()
{
ptr temp;
if(more())
{
temp=stop;
c[count]=temp->palin[count];
palin(c);
stop=stop->next;
delete temp;
count++;
}
}
this one is the palin function
void stack::palin(char c[10])
{
if(r[count]==c[count])
{
check=1;
}
else
{
check=0;
}
}
and i got this error
- c 0x0012ff42 "ÌÌÌÌÌÌÌÌÌÌ" char [10]
[0] -52 'Ì' char
[1] -52 'Ì' char
[2] -52 'Ì' char
[3] -52 'Ì' char
[4] -52 'Ì' char
[5] -52 'Ì' char
[6] -52 'Ì' char
[7] -52 'Ì' char
[8] -52 'Ì' char
[9] -52 'Ì' char
____________________________________________________________________________________
- stop 0x00000000 {palin=0x00000000 <Bad Ptr> next=??? } stack::t1 *
- palin 0x00000000 <Bad Ptr> char [10]
[0] CXX0030: Error: expression cannot be evaluated
[1] CXX0030: Error: expression cannot be evaluated
[2] CXX0030: Error: expression cannot be evaluated
[3] CXX0030: Error: expression cannot be evaluated
[4] CXX0030: Error: expression cannot be evaluated
[5] CXX0030: Error: expression cannot be evaluated
[6] CXX0030: Error: expression cannot be evaluated
[7] CXX0030: Error: expression cannot be evaluated
[8] CXX0030: Error: expression cannot be evaluated
[9] CXX0030: Error: expression cannot be evaluated
next CXX0030: Error: expression cannot be evaluated
______________________________________________________________________________________
- temp 0x00000000 {palin=0x00000000 <Bad Ptr> next=??? } stack::t1 *
+ palin 0x00000000 <Bad Ptr> char [10]
next CXX0030: Error: expression cannot be evaluated
______________________________________________________________________________
- temp->palin 0x00000000 <Bad Ptr> char [10]
[0] CXX0030: Error: expression cannot be evaluated
[1] CXX0030: Error: expression cannot be evaluated
[2] CXX0030: Error: expression cannot be evaluated
[3] CXX0030: Error: expression cannot be evaluated
[4] CXX0030: Error: expression cannot be evaluated
[5] CXX0030: Error: expression cannot be evaluated
[6] CXX0030: Error: expression cannot be evaluated
[7] CXX0030: Error: expression cannot be evaluated
[8] CXX0030: Error: expression cannot be evaluated
[9] CXX0030: Error: expression cannot be evaluated
really need some help !!
NB: sorry if this is thread is same Repost