Originally Posted by
morngrym
Thanks i seem to have it working how i want now, the strcat(string, &c) seems to work well
That will not work since strcat required a NULL terminated string. The address of c does not contain the NULL terminated string. Most likely, your code will crash.
Code:
#include <iostream>
#include <conio.h>
#include <ctype.h> //please do not worrry about all these headers
#include <cstring> // i have been trying different commands
#include <stdio.h>
using namespace std;
int main(void)
{
char *p, *endp;
char string[256];
char kb;
memset(string, 0, sizeof(string));
p = string;
pend = p + (sizeof(string) - 1);
kb = 0;
while(kb!= 27 && p != endp) {
if (_kbhit()) {
kb =_getch();
_putch(kb);
if (kb != 13) {
*p++ = kb;
}
}
}
}