|
-
Aug 4th, 2001, 10:10 PM
#1
Thread Starter
PowerPoster
simple: How do search a dot in a string
How do know if there is one or more "." in a string.
If there is any "." then I perform certain action, and If there is non then I do something else
-
Aug 5th, 2001, 05:11 AM
#2
transcendental analytic
Code:
for (char*i=string;*i;++i)
if (*i='i')
;//cetain action
else
;//something else
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 8th, 2001, 07:22 PM
#3
Thread Starter
PowerPoster
Thanks man!
-
Aug 9th, 2001, 04:24 AM
#4
Monday Morning Lunatic
Originally posted by kedaman
Code:
for (char*i=string;*i;++i)
if (*i='i')
;//cetain action
else
;//something else
*cough*
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 9th, 2001, 02:35 PM
#5
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 11th, 2001, 09:38 AM
#6
PowerPoster
or using strstr function
PHP Code:
char *Source = new char[10];
char *Search = new char[1];
char *p1=0;
char *tmp = new char[30];
strcpy(Source, "abcdef.ghi");
strcpy(Search, ".");
p1 = strstr(Source, Search);
if (p1 != NULL)
{
sprintf(tmp, "Dot found at address %ld", &p1);
MessageBox(hDlg, tmp, "Search", MB_OK);
}
else
{
MessageBox(hDlg, "No dot fuond.", "Search", MB_OK);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|