hi,
how do you check to see if there is a white space b/t 2 characters? thanks in advance.
hi,
how do you check to see if there is a white space b/t 2 characters? thanks in advance.
Search for a ' ' in the string.
I could be wrong though. More times than not, I'm usually worng the first time.
DrakkenKorin
Get off my Intarweb!!!!
You're correct, except that more than just 'space' are considered 'white space'. Use something like:
EDIT: Edited to provide a link to 'isspace'.Code:for( x=0; string[x]; x++ ) if( isspace( string[x] ) ) printf("witespace at %d, ascii value of %d.", x, string[x] );
NOTE: There are numerous 'is' functions in ctype.h.
Quzah.
Last edited by quzah; 12-10-2001 at 04:13 PM.
Hope is the first step on the road to disappointment.
thanks, but i need to ignore white spaces in front and at the end of the string. i just need to check for spaces in between 2 valid characters.
thanks.
quzah:
In your code, you use -- isspace(string[x])
Is this a user defined function, or is in one of the header/library files?
Thanx
DrakkenKorin
Get off my Intarweb!!!!
DrakkenKorin:
You can find command "isspace(string[x])" in "ctype.h" library.
Current projects:
1) User Interface Development Kit (C++)
2) HTML SDK (C++)
3) Classes (C++)
4) INI Editor (Delphi)
Homework?
Use isspace or the ' ' literal in your search and choose whether or not to copy it to a temp variable. Re-copy, return.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Thanx Gape.
Gonna have to play with that one.
DrakkenKorin
Get off my Intarweb!!!!