|
|
tag reverse search on a non-null terminated char str stackoverflow.com
src is a non-null terminated char string whose length is data_len I want to start from the end of tis array, and find the first occurrence of html tag... find_pos should ...
Or better yet, you can just use this form: char my_string[] = "the compiler will determine this string's size"; This way, you will not have to worry about knowing the actual string size as long as you don't plan on changing the string during runtime. Even better if you make it a "const char" for added safety.
that doesn't work. well it works, but it doesn't work well. if you allocate memory to username then set it to null, you lose the only reference you had to the memory and can't free it. that's called a memory leak. if you point username to an existing array you can set it to null but that doesn't change the actual ...
Hi mate, Cheers for that! Perhaps it's a good time to ask why? I had to declare it as a pointer because the function (that returns the value). Is that the common rule for a pointer? You can check their values outright instead of having to use one of the str* type of functions? Cheers
| java2s.com | Contact Us | Privacy Policy |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |