From Greg Aluise · 1996-03-31 20:18 · #73520 in EMULATE
Thanks alot for your help, I did figure out what I wanted
to do, Instead of using dos System services, I just used BIOS routines...
Now a real C question:
I am trying to get an integer out of the following code:
#include <conio.h>
#include <iostream.h>
void main(void)
{
int var1;
int var2;
char buffer[80];
char *string
cout <<"Enter a number:";
buffer[0]=3;
string = cgets(buffer);
v1 = int(string);
cout <<"\n\rEnter a second number to add to first:";
buffer[0]=3;
string = cgets(buffer);
v2 = int(string);
cout <<"\n\rThe result is: " << (v1 + v2);
}
When I compile this code, it compiles fine with no warning
or errors, but when I run the exe and enter like 1 & 2, it comes up with 65344, now the only reason I am using cgets instead of cin, is because I want the program to input info in different colors in text mode, if somebody knows how to make this work, or to make cin work in different colors I would GREATLY!! appreciate it... ren
Thanks - Greg Aluise
--- Opus-CBCS 1.73a
* Origin: DelaMarPenn MicroNet -+- Newark, Delaware (1:150/115.0)