Hello im kinda new with C++ and im trying to have a program that reads in a keyboard press while the programs continues to run. i seem to have that part of it ok but im trying to create a string with each new key pressed but i get a error that i cant seem to get around. Any help would be good
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 string[256];
int kb;
while(kb!= 27)
{
if (_kbhit())
{
kb =_getch();
_putch(kb);
if (kb != 13)
{
string[0] = '\0';
char c = char(kb);
strcat(string, c); // problem is here. i get a error which is
//" cannot convert parameter 2 from 'char' to 'const char *'"
}
}
}
}