Hi.

I have a function which checks for a placement of a substring in a buffer after recieving it over TPC. It checks for the value up until a '&' appears in the string (As the value can be any length). However, my program crashes if the packet has no '&' symbol (For example, when the value is longer than the packet length and as such goes into the next packet).

Is there a method to check if a character ('&' in this case) exists in a string?

Thanks in advance.

Hi.

I have a function which checks for a placement of a substring in a buffer after recieving it over TPC. It checks for the value up until a '&' appears in the string (As the value can be any length). However, my program crashes if the packet has no '&' symbol (For example, when the value is longer than the packet length and as such goes into the next packet).

Is there a method to check if a character ('&' in this case) exists in a string?

Thanks in advance.

Try find from the string library.

Cheers guys, worked like a charm =)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.