rjsma Posted October 16, 2009 at 02:49 PM Report Share #291899 Posted October 16, 2009 at 02:49 PM fiz este programa mas da me erro queria saber se alguem podia me ajudar #include<iostream> #include<stdlib.h> #include<conio.h> using namespace std; int main() { char letra; cout<<"Introduza letra (L/D/F) :"; cin>> letra; switch(letra) { case 'L' ; cout<<"ligar"; break; case 'D'; cout<<"desligar"; break; case 'F'; cout<<"Furar"; break; default: cout<<"operacao invalida"; } getch(); } Link to comment Share on other sites More sharing options...
IceBrain Posted October 16, 2009 at 03:02 PM Report Share #291901 Posted October 16, 2009 at 03:02 PM Estás a programar em Windows ou Linux? Porque a biblioteca conio.h, da qual faz parte a função getch(), só existe em Windows. ❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents A list of command line apps Link to comment Share on other sites More sharing options...
Rui Carlos Posted October 16, 2009 at 03:04 PM Report Share #291902 Posted October 16, 2009 at 03:04 PM Dava jeito indicares o erro que te está a dar... Rui Carlos Gonçalves Link to comment Share on other sites More sharing options...
IceBrain Posted October 16, 2009 at 03:08 PM Report Share #291903 Posted October 16, 2009 at 03:08 PM Ah, depois de cada 'case', é suposto usares dois pontos e não ponto e vírgula: case 'teste': codigo; ❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents A list of command line apps Link to comment Share on other sites More sharing options...
rjsma Posted October 16, 2009 at 04:11 PM Author Report Share #291907 Posted October 16, 2009 at 04:11 PM ja funciona obrigado Link to comment Share on other sites More sharing options...
jpaulino Posted October 16, 2009 at 04:49 PM Report Share #291911 Posted October 16, 2009 at 04:49 PM ja funciona obrigado Tens de te começar de uma vez por todas a colocar no titulo qual o problema e não um pedido de ajuda , ok ? 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