Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ String Compare Example

#include <iostream>  
#include <cstring>  
using namespace std;  
int main ()  
{  
  char key[] = "Softhunt.net";  
  char buffer[50];  
  do {  
     cout<<"Which is your favourite tutorial website? ";  
     cin>>buffer;  
  } while (strcmp (key,buffer) != 0);  
 cout<<"Answer is correct!!"<<endl;  
  return 0;  
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #String #Compare #Example
ADD COMMENT
Topic
Name
6+2 =