Search
 
SCRIPT & CODE EXAMPLE
 

CPP

txt auslesen c++

#include <iostream>
#include <fstream> //Die Bibliotheken auf die wir zugreifen
using namespace std;

int main(){//unsere Methode(muss nicht die main sein)
	string pfad("Bsp:/Bsp/Bsp/Bsp.txt"); //speichern des Dateipfad in einem String
    string numb; //die Zeilen werden später als String gespeichert und ausgegeben !GEHT AUCH MIT ANDEREN DATENTYPEN!
  	ifstream input_file(path);
  	while(input_file >> numb){ //Schleife wird ausgeführt bis jede Zeile durchgegangen wurde
    	cout << numb << endl;  //jede Zeile wird als String ausgegeben
    }
}

//wenn ich helfen könnte würde ich mich über eine kleine Spende freuen
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ qt qtreewidget lock first column 
Cpp :: how to get steam id c++ 
Cpp :: Explicit conversion casting 
Cpp :: 1/2(-3-3)(-3+4) 
Cpp :: how to writte comment in c++ 
Cpp :: Targon lol 
Cpp :: find the mminimum of the vector and its position in c++ 
Cpp :: C++ if...else 
Cpp :: sinh to hop c++ 
Cpp :: all in one c++ 
Cpp :: Use command line arguments to create file c++ 
Cpp :: generate consecutive numbers at compile time 
Cpp :: c++ How to not use friend declaration when equipping a class with `operator<<` 
Cpp :: c pointer syntax 
Cpp :: count substrings codechef solution in c++ 
Cpp :: cuda allocate memory 
Cpp :: left recursion program in c++ 
Cpp :: c++ operators 
Cpp :: sort 3 numbers using swap cpp 
Cpp :: csv 
Cpp :: c++ multiplication table rows and columns 
Cpp :: 496. Next Greater Element I.cpp 
Cpp :: qrandomgenerator bounded 
Cpp :: powers of 2 in cpp 
Cpp :: c++ find in pair 
Cpp :: Set Specific Time in youtube Video url 
Cpp :: equal elements in two arrays in c++ 
Cpp :: c++ delete int 
C :: stop redis server 
C :: printf format specifiers 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =