#include<stdio.h>
void main()
{
System("C:\\Example.txt");
}
This is working in Dev C++ , but when i run in turbo C "Illegal Command " Error occurs
#include<stdio.h>
void main()
{
System("C:\\Example.txt");
}
This is working in Dev C++ , but when i run in turbo C "Illegal Command " Error occurs
The problem with you is not your code but the environment you use. Dev c++ works on the same environment as that of notepad and thus it is accessible but the turbo c is an emulator and don't gave you same environment. In other words turbo c is an emulator based application and runs in dos like environment thus dosbox mount the folder of turbo c and elevates it to dos environment. In dos environment there is no notepad and even the command that uses the windows graphical api will give you error.
If you want to know what is a emulator then just google for vmware or oracle workstation. And see that when you run a virtual machine what happens.
System() is not supported in turbo c++.
If you want to load text file use fstream to load text file.