Answers for "C++ String Compare Example"

C++
-1

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;  
}
Posted by: Guest on May-05-2022

Browse Popular Code Answers by Language