checking last char of string in c

Posted by radar75 on Stack Overflow See other posts from Stack Overflow or by radar75
Published on 2010-04-07T21:29:11Z Indexed on 2010/04/07 21:33 UTC
Read the original article Hit count: 402

Filed under:
|

If I have two types of strings as:

const char *str1 = "This is a string with \"quotes escaped at the end\""; 
const char *str2 = "This is a \"string\" without quotes at the end"; 

testFn(str1);
testFn(str2);

int testFn(char *str)
{
  // test & return 1 if ends on no quote
  // test & return 0 if ends on quote
  return;
}

I would like to test if the string ends with a quote " or not

What would be a good way of testing this? Thanks

© Stack Overflow or respective owner

Related posts about c

    Related posts about string