Nun0 Posted April 12, 2014 Report Share Posted April 12, 2014 Boas malta, estou a tentar implementar este código: #include <stdio.h> int um_dos (char palavra1[] , char palavra2[]) { int i = 0; int j; while (palavra1 [i] != '\0') { for (j=0; palavra2 [j] != '\0'; j++) { if (palavra1 [i] == palavra2 [j]) { return i; } } i++; } return 1; } int main () { printf("%d\n" , um_dos ("maria" "rocarzito")); return 1; } E está sempre a dizer que tem poucos argumentos, alguém me pode ajudar? Link to comment Share on other sites More sharing options...
polska Posted April 12, 2014 Report Share Posted April 12, 2014 printf("%d\n" , um_dos ("maria" "rocarzito")); não falta nada a separar os dois argumentos "maria" e "rocarzito" ? Corrige um sábio e ele mais sábio ficará. Corrige um ignorante e um inimigo ganharás. Link to comment Share on other sites More sharing options...
Nun0 Posted April 12, 2014 Author Report Share Posted April 12, 2014 O que uma vírgula faz xD Muito obrigado amigo, já funciona, abraço. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now