D
Durgesh Sharma
Hi All,
Pleas help me .I am a starter as far as C Language is concerned .
How can i Right Trim all the white spaces of a very long (2000 chars)
Charecter string ( from the Right Side ) ? or how can i make a fast
Right Trim Function in c,using Binary search kind of fast algorithm ?
Offcourse...I can use the classical approach too.
like :
Start from the right most charecter of the string to the left of the
string and stop where we find the first none-whitespace charecter and
insert a NULL charecter,after increasing one place.It is working
fine.But problem is that suppose my string can hold 2000
charecters,but in a particular case i have only 1 charecter in my
string ,then i will have to sequentially traverse from charecter
position 2000 to 1 (1999 sequential searches) to put a NULL char at
position number 2.
String is of varying length sometime it can be of 2 charecters long
and other time it can have 2000 charecters too.
How can i use Binary search kind of fast search mechanism in the above
scenario in my function.
Please help me.
Thanks in advance.
Regards,
Durgesh Sharma
Pleas help me .I am a starter as far as C Language is concerned .
How can i Right Trim all the white spaces of a very long (2000 chars)
Charecter string ( from the Right Side ) ? or how can i make a fast
Right Trim Function in c,using Binary search kind of fast algorithm ?
Offcourse...I can use the classical approach too.
like :
Start from the right most charecter of the string to the left of the
string and stop where we find the first none-whitespace charecter and
insert a NULL charecter,after increasing one place.It is working
fine.But problem is that suppose my string can hold 2000
charecters,but in a particular case i have only 1 charecter in my
string ,then i will have to sequentially traverse from charecter
position 2000 to 1 (1999 sequential searches) to put a NULL char at
position number 2.
String is of varying length sometime it can be of 2 charecters long
and other time it can have 2000 charecters too.
How can i use Binary search kind of fast search mechanism in the above
scenario in my function.
Please help me.
Thanks in advance.
Regards,
Durgesh Sharma