running c++ programme IN SHELL SCRIPT

February 28, 2011 at 21:59:53
Specs: Windows XP 65 bit
i want to open notepad through c++ programme and want to run in shell script check programme for errors
// programme.
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
const int SIZE = 100;
char fileName [SIZE];
char ch;
fstream file;

// Get the file name
cout << "Enter a file name: ";
cin >> fileName;

// Open the file.
file.open(fileName, ios::in);
if (!file)
{
cout << fileName << " could not be opened.\n";
return 0;
}

// Get each character from the file and display them.
file.get(ch);
while (!file.eof())
{
cout << ch;
file.get(ch);
}

system("notepad c:\\InPutfile.txt");

// Close the file.
file.close();
return 0;
}


See More: running c++ programme IN SHELL SCRIPT

Report •


#1
March 1, 2011 at 00:56:32
karnamsowjanya, suspect you'll get more and more knowledgeable responses in the programming forum @:
http://www.computing.net/forum/prog...
HTH
Ed in Texas

Report •

#2
March 1, 2011 at 21:10:35
VERIFY PROGRAMME

Report •
Related Solutions


Ask Question