#include <iostream>
#include <fstream>
// introduces namespace std
using namespace std;
const char * file = "Data.txt";
int main (int argc, char * const argv[]) {
char ch;
ifstream fin;
fin.open(file);
if (fin.is_open()) {
while (fin.get( ch ) )
cout << ch;
}
fin.close();
return 0;
}
This code worked in CodeWarrior but I cannot get it to work in Xcode.
Thanks for looking!
barnwillyb
This post has been edited by JackOfAllTrades: 23 December 2011 - 03:50 AM

New Topic/Question
Reply




MultiQuote





|