Ruka284 Posted September 27, 2013 at 12:40 PM Report #526296 Posted September 27, 2013 at 12:40 PM Vinha solicitar opinião e qual o processo de fazer a ligação a uma função. int soma (int num1, int num2) - isto e a função a seguir tenho case: ~~ printf("\n O resultado e:%d",soma (i)); Como faço no case a ligação há função?
HappyHippyHippo Posted September 27, 2013 at 01:08 PM Report #526298 Posted September 27, 2013 at 01:08 PM no protótipo, quantos argumentos diz existir para a função ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
pikax Posted September 27, 2013 at 01:09 PM Report #526299 Posted September 27, 2013 at 01:09 PM a funcao soma leva 2 argumentos, e tu estas a chamar a funcao so' com 1 argumento! Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender. A beleza de um código está em decompor problemas complexos em pequenos blocos simples. "learn how to do it manually first, then use the wizzy tool to save time." "Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast."
Ruka284 Posted September 27, 2013 at 01:14 PM Author Report #526300 Posted September 27, 2013 at 01:14 PM no protótipo, quantos argumentos diz existir para a função ? int soma (int num1, int num2) - dois a funcao soma leva 2 argumentos, e tu estas a chamar a funcao so' com 1 argumento! ~~ printf("\n O resultado e:%d",soma (i)); - [b]tenho de acrescenter num1 e num2, certo?[/b]
thoga31 Posted September 27, 2013 at 01:25 PM Report #526304 Posted September 27, 2013 at 01:25 PM Tens de acrescentar num1 e num2?... Não tens de acrescentar nada, tens é de invocar a função como deve ser, clear and simple. A função soma tem dois argumentos. Logo, tens de a invocar com dois argumentos, and that's that. Knowledge is free!
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