HI can anyone help here.. how do you get rid of a quote character like this "\", inside a string..
say i read a string in input then i want to escape the backslash character "\" inside a string.. how can i do that?
cheers
Atif.
HI can anyone help here.. how do you get rid of a quote character like this "\", inside a string..
say i read a string in input then i want to escape the backslash character "\" inside a string.. how can i do that?
cheers
Atif.
char c[10];
int i = 0, int max;
while ((c[i] = getc(stdin)) != '\n')
{
if (c[i] == ' \ \')
QUOTE]there should be two \ inside the apostrophes '\\' [/QUOTE]
continue;
else
i++;
}
max = i;
i = 0;
while (i<max)
{
printf("%c", c[i]);
i++;
}[
Last edited by Drako; 04-09-2002 at 05:07 AM.
I guess it should be '\\' rather than '\'....if (c[i] == ' \ ')
so the statement becomes...
if(c[i]=='\\')
---
---
---
Regards,
Sriharsha.
Help everyone you can
That's correct. The difference between "\" and '\' is that '\' is a character and "\" is a null-terminated string.
what is the difference between "\" and "\0"
>what is the difference between "\" and "\0"
'\', '\0'
and
'\', '0', '\0'
-Prelude
My best code is written with the delete key.