#include "stdafx.h" #include <iostream> #include <cstring> using namespace std; int strcmp(char str[], char str2[]) { if (str < str2) return -1; /*{ cout << "l e s s e r" << endl; }*/ else if (str > str2) return 1; /*{ cout << "g r e a t e r" << endl; }*/ else if (str == str2) return 0; /*{ cout << "e q u a l i t y" << endl; }*/ // what should i write here.. ?? this is causing a warning message from compiler. } int main() { const int length = 15; char red[length], black[length]; // two strings that can hold 15 characters including null character. cout << "Enter First STRING: "; cin.getline(red, length+1); // user allowed to enter a string of 15 characters + 1 for null character. cout << "Enter Second STRING: "; cin.getline(black, length+1); strcmp(red, black); system("Pause"); return 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)