Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // gestion_archivos.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include<string>
- #include <fstream>
- #include<sstream>
- #include<vector>
- using namespace std;
- char Nombre[15], Fecha[15];
- vector<string> row;
- int rollnum, roll2, count = 0;
- string myText, line, word;
- int columnaUno[10000], columnaDos[10000];
- int main() {
- // Create and open a text file
- int i=0;
- ifstream MyFile("prueba7A2.txt");
- while(getline (MyFile, myText))
- {
- row.clear();
- stringstream s(myText);
- while (getline(s, word, ','))
- {
- row.push_back(word);
- }
- //roll2 = stoi(row[0]);
- cout<<"Dato en la ubicacion cero:"<<row[0]<<" dato en la ubicacion uno:"<<row[1]<<endl;
- columnaUno[i]=stoi(row[0]);
- columnaDos[i]=stoi(row[1]);
- i++;
- //system("pause");
- }
- // Close the file
- MyFile.close();
- system("Pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment