Hello, sorry if I'm asking a lot of questions, but is there any way to convert a char to char*?
I'm reading a string one by one, and if i find a certain character i want to push it to a stack, however my stack contains a char*.. how do i do this? :\
Code:
while(*x!='\0')
{
if(*x=='(')
{
char* temp = *x;
push(&(*top),temp);
}
..
obviously this doesn't work..neither does this
Code:
if(*x=='(')
{
char* temp;
strcpy(temp,*x);
push(&(*top),temp);
}
I tried this, but i'm not sure if its correct?
Code:
if(*x=='(')
{
char temp[2] ="(";
char *p = temp;
push(&(*top),p);
}