Untitled

mail@pastecode.io avatar
unknown
plain_text
18 days ago
676 B
6
Indexable
Never
#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

//4)
void string_comp(char s1[100], char s2[100], int E);

int main(){
    
}

void string_comp(char s1[100], char s2[100], int E){
    //A) get the length of the string 1
    int i, ls1;
    i =0;
   while(s1[i] != '\0') i++;
   ls1 = i;
    
      //B) get the length of the string 2
    int j, ls2;
    j =0;
   while(s2[i] != '\0') j++;
   ls2 = j;
   
    //C) compare the characters of the strings
    for(i=0; i<=ls1; i++){
        for(j=0;j<=ls2;j++){
            
            if(s1[i] == s2[i] ) E = 1;
            
            else E = 0;
            
        }
        
    }
    
    
}
Leave a Comment