Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void){
- _Bool stringsIguais(char s1[], char s2[]);
- if(stringsIguais("casa", "casa")){
- printf("Sao Iguais\n");
- } else{
- printf("Nao sao Iguais\n");
- }
- return 0;
- }
- _Bool stringsIguais(char s1[], char s2[]){
- int i = 0;
- while(s1[i] == s2[i] && s1[i] != '\0' && s2[i] != '\0'){
- ++i;
- }
- if(s1[i] == '\0' && s2[i] == '\0'){
- return 1;
- } else{
- return 0;
- }
- }
- //Sobre
- //Aula: Verificar Igualdade Entre Duas Strings (#51)
- //Data: 31/01/2021
- //Grupo: /r/heikoa
- //Referencia:
- //Video: youtube.com/watch?v=sOT6n8JTX-U
Add Comment
Please, Sign In to add comment