I've tried using getch() but the problem I have is that it requires enter to be pressed, I want to grab a character and move on as soon as the user presses that character key, no hanging round if you...
Type: Posts; User: Dunners
I've tried using getch() but the problem I have is that it requires enter to be pressed, I want to grab a character and move on as soon as the user presses that character key, no hanging round if you...
Hey all,
is it possible to use cin to grab a character from the buffer without the user having to press enter, etc? i.e. as soon as the key is pressed the character goes into the variable used...
Sorry I have the endif in the actual file, I would copy and paste them direclty but there's about 1000 lines of code which is why I really want to split them. For some reason I'm getting the same...
This one seems to have me well and truly whipped. It keeps complaining that I'm redefining the functions but I can't figure out why. If you can shed anymore light on this it would be appreciated....
Hello All!
I am attempting to split up a class into two files, a .h and a .cpp but I'm getting so many errors that it's mad. Basically I have in my header file:
#if !defined MY_CLASSES_H...
Cheers boss! At last it's all working, I'm so happy I think I'll cry myself to sleep!
I'm sorry guys, I swear this will be my last post of the day :)
How would I return a structure from function a to function b so that I can acces the data members of the structure in function b?
...
cheers, I'll give that a try. I think the compiler I have has getch() so everything should be grand. About 30 more minutes work and I should be able to get some kip, 17 hours programming (with a...
The basic thing is the user has to enter a "passcode" of 4 numbers which are stored in an integer when the user presses enter. I want a * to appear on screen when they press the numbers rather then...
Hi
Is it possible to mask input gained using cin so that when a user type a different character (e.g. *) is displayed rather than the character they typed?
Cheers
Oh now that is a pain in the rear. So to remove a single record from the file I'll have to copy all the records into the program one at a time, writing them into a new file before copying the next...
Cheers! Got that working now :)
I know I'm being a pain but is it possible to delete a specific line from a file or append a section of that line? My program basically reads in information from a...
Hi
I'm having trouble with breaking from a loop when I reach the end of a line. Basically the program moves through each line, loads it into memory and checks a variable to see if it matches one...
Hi,
Is it possible to add items to the beginning of an existing file without overwriting the data that already exists in the file? I have tried using ios::app but that only seems to let me append...
Hi,
Basically what I'm doing is outputting several variables to a file and then read them back into those variables at a later stage. This can be done several times with each set of variables...
that's working now, Cheers!
Hi,
I'm trying to dynamically specify a filename to be equal to something the user specifies at an earlier point in the system. The code I have is...
ofstream out;
out.open(file,...
Hi guys,
Is it possible to jump from one line to another in a file when using the getline() command to read data in without having to pad out the lines so that they are all the same length and...
I'm supposed to be using C++ but that chunk of code was a bit of an edit of some older C code I had, I'll tidy it up before I put it in my project. Knowing my teacher if I don't there will be hell to...
Hi,
I had a fiddle myself and managed to come up with this.
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
That doesn't seem to work. The program just hangs on the getch() until the user inputs a value. I need it to break out as soon as the user enters a value or after a set period of time even if the...
Cheers, I think that might be what I'm looking for, I'll let you know how it goes. Thanks again
Hi,
I was just wondering is it possible to put a timeout on input in a C++ program (i.e. the user has a set time to enter a value before the program moves on). If this is possible where would I...