Created
May 15, 2011 20:13
-
-
Save knutsun/973490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
ifstream infile; | |
char string[81]; | |
infile.open("data.txt"); | |
if(!infile) | |
{ | |
cerr << "Error: file could not be opened" << endl; | |
return 1; | |
} | |
infile.getline(string, 81); | |
int a = 0; | |
for(int k=0; k < string[a]; a++) | |
{ | |
cout << string[a] << endl; | |
} | |
infile.close(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment