473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

getch() and some more!!

I need your help please!!
I have this code (and as you can see my level in c++ programming is the worst) and i have to add two others functions to de aplication.
1. When it says "Escoja una opcion" i need it to start the action without hiting enter. Someone said it must be done with getch() but i've tried and i cant make it to work because it (c++) is very new for me and i do not know the sintaxis.
2. This program is for playing some video files so i need it to keep waiting for another instruccion after finishing one video.
Please help me! this is a work for monday and i don't really know how to do it.
Thanks!
Sorry for my bad english!
Jan 19 '07 #1
1 1093
Sorry, i didn't paste de piece of code in the post above. There it goes:

Expand|Select|Wrap|Line Numbers
  1. #include <iostream.h>
  2. #include <ncurses.h>
  3. #include<stdio.h>
  4.  
  5. int main()
  6. {
  7.  
  8. char number;
  9.  
  10.     cout << "Escoja una opcion\n";
  11.     cin >> number;
  12.  
  13.     switch (number)
  14.     {
  15.         case '0':
  16.             system("mplayer -fs '3 Doors Down - Kryptonite.mpeg'");
  17.         break;
  18.         case '1':
  19.             system("mplayer -fs 'Serena Brooke surfing (fuel.tv).flv'");
  20.         break;
  21.         case '2':
  22.             system("mplayer -fs 'Serena Brooke surfing (fuel.tv).flv'");
  23.         break;
  24.         default:
  25.             cout << "No escogio ninguna opcion\n";
  26.     }
  27. }
I supose that i need to say that i'm doing it under Linux.
Jan 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: bearophile | last post by:
Ville Vainio: >It's highly typical for the newbies to suggest improvements to the >language. They will usually learn that they are wrong, but the >discussion that ensues can be fruitfull anyway...
1
by: D2CAD | last post by:
function productprice(img,titel,path,bestand1) { features = 'toolbar=yes,location=no,directories=no,status=no,menubar=no,' + 'scrollbars=yes,resizable=no,width=680,height=600' dlg = window.open...
4
by: Smitro | last post by:
Hi, How come in some statements I can use: If (something) or DIE(); but other times it won't work (returns an error) unless I take out the OR. Is there any documentation on this anywhere?
0
by: My Deja | last post by:
Where can I learn some more about the Rule system in PostgreSQL( ie besides the manual)? I'd also want to learn what query trees are generated by my queries? How can I get them to show up? I am...
0
by: mike | last post by:
Recently I posted a message about deploying an application over a network. I had the .net framework installed on the pcs, the local intranet set to full trust, and I had copied the bin directory to...
2
by: at(nospam) | last post by:
I have a problem with PHP. If I had a string with a lot of text, how can I then make a function, which can split the text up in some more lines, if I define how long the line have to be, and it...
2
by: Joseph Kesselman | last post by:
Since the recent "Docbook on Windows" question brought this up... I did a bit of checking on the current status of these schemas, what they're intended for and how they interrelate. IBM's Robert...
1
by: monsalvo | last post by:
Hello. I've just coded a VBScript SOAP Client to send requests to a web service in our intranet. It's working and we'll use it in a DTS cuz we have not implemented SQL Server 2005 yet. Anyway. I...
8
by: chanshaw | last post by:
Alright this runs just fine in IE but in firefox I get nothing function startup() { if (window.ActiveXObject) { xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); }...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.