|
-
Nov 10th, 2001, 12:14 PM
#1
Thread Starter
Lively Member
-
Nov 10th, 2001, 12:43 PM
#2
PowerPoster
To compare two strings, you use "strcmp" providing it two strings to compare. I'll return 0 if both are same, <0 if first string is less than the second string, >0 if first string is greater than the second string.
PHP Code:
#include <iostream.h>
#include <string>
void main()
{
char string1[20] = "Hello";
char string2[20] = "Boy";
if (strcmp(string1,string2) == 0)
{
cout<<"Both strings are same";
}
To get some specific characters from a string, check out this thread:
http://www.vbforums.com/showthread.p...hreadid=115560
-
Nov 10th, 2001, 12:49 PM
#3
Thread Starter
Lively Member
-
Nov 10th, 2001, 12:51 PM
#4
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
|