< and > as characters in C?
#1
I was trying to write a filter to locate some things in HTML and I was quite surprised by this.  If I do strstr() to search for <label> it's not found, but grep or search in the mc file viewer can find it.
I even tried putting them in as ASCII codes: snprintf(lbl,20,"%clabel%c",0x3c,0x3e); and it doesn't find them in the HTML.  If I look at the HTML in hex mode of mc's file viewer they seem to be normal ASCII, not unicode.

This is nothing specific to a PBP except that I'm using gcc under Daniel Thompson's Bullseye on one.  I tried escaping them by putting a \ in front of each one, that doesn't work.  I'm pretty sure I've searched for HTML tags in C years ago, I don't remember this strangeness.
  Reply


Messages In This Thread
< and > as characters in C? - by ab1jx - 01-18-2021, 06:16 PM
RE: < and > as characters in C? - by ab1jx - 01-18-2021, 07:38 PM
RE: < and > as characters in C? - by barray - 01-18-2021, 08:59 PM
RE: < and > as characters in C? - by ab1jx - 01-19-2021, 06:47 AM
RE: < and > as characters in C? - by barray - 01-20-2021, 04:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Keyboard types random characters erock22 10 10,944 10-30-2020, 08:53 PM
Last Post: erock22
  Darktable - characters are square PaulQ 7 9,997 09-13-2020, 10:38 PM
Last Post: kenigan

Forum Jump:


Users browsing this thread: 2 Guest(s)