05-06-2004 09:37 AM
05-07-2004 05:07 AM
05-09-2004 05:11 AM
05-10-2004 03:09 PM
07-12-2005 11:02 AM
Hello Ryank,
I know it's been awhile since we discussed this issue...but I happend to face this problem again.
Searching the code of this particular driver I found this..
/*************************************************************/
/* In the standard c template, the scan format string is */
/* "%t%*t". This removes white space from the end of the */
/* returned string, but doesn't work if there are */
/* embedded spaces in the returned string. I used this */
/* format string and resorted to stripping off spaces and */
/* spaces and trailing non-printing characters below. */
/*************************************************************/
since you must be more knowlagable than me int he C language. can you explain how is the best way to modify the code.
The source is ...%*t it comes if different ways like
sscanf(temp_str, "%lf%*t", r64Result);
sscanf(temp_str, "%hd,%hd%*t", i16ResultA, i16ResultB);
sscanf(temp_str, "%hd,%hd%*t", i16ResultA, i16ResultB);
Thanks Very much
Rafi
07-13-2005 11:59 AM
Hello Rafi,
If you want to remove trailing whitespace, you can try removing the %*t all together: sscanf(temp_str, "%lf", r64Result);
If instead you want to remove any character that is not a number or a letter, you can try doing something like: sscanf(temp, "%lf%*[^a-zA-Z1-9]", r64result);
Hope that helps.