I'm pretty sure you don't need process.h, but you do need stdlib.h/<cstdlib> to use exit() and declare 'using namespace' after you've declared all your include files
#include <iostream>
#include <conio.h>
usingnamespace std;
int main() {
char c;
int i=0;
cout << "Enter the line till Enter key\n";
while ((c=getche())!='\n') {
i++;
}
cout <<i<<"\n";
return 0;
}
l4.c:2:19: error: conio.h: No such file or directory
l4.c: In function ‘int main()’:
l4.c:11: error: ‘getche’ was not declared in this scope
But i inlcuded all need to work, as i seen at example (
It's best you avoid stuff like conio.h to begin with, unless you really, really need to (which is basically only when you need extraordinarily fancy console applications, for which the only justification I can think of right now would be you want to develop a roguelike. Other than that, just make it a GUI application). Instead of using random nonstandard C-style functions like getch(), getche() or stuff like that, use iostreams like cin. You already use the ostream cout, it will only hurt your consistency if you don't also use an istream like cin for input.