Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how to get a word from file c++

void readFile()
{
    ifstream file;
    file.open ("program.txt");
    if (!file.is_open()) return;

    string word;
    while (file >> word)
    {
        cout<< word << '
';
    }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: qt qstring to double 
Cpp :: casting pointer (int to char*) in c++ 
Cpp :: c++ string to double 
Cpp :: check if c++ is installed 
Cpp :: PI IN C++ WITH CMATH 
Cpp :: cpp random number in range 
Cpp :: c++ parse int 
Cpp :: c++ print current time 
Cpp :: c++ loop pyramid 
Cpp :: how to delete a certain amount of numbers of the same value in multiset c++ 
Cpp :: Sort array using inbuilt sort function in decreasing order 
Cpp :: c++ cli convert string to string^ 
Cpp :: extends c++ 
Cpp :: 2d vector c++ declaration 
Cpp :: how to get a letter from the users string in c++ 
Cpp :: capitalize first letter c++ 
Cpp :: how to iterater map of sets in c++ 
Cpp :: c++ swapping two numbers 
Cpp :: c++ open file 
Cpp :: c++ find element in vector 
Cpp :: random number cpp 
Cpp :: how to put bitset into a string in c++ 
Cpp :: c++ length of char array 
Cpp :: Write C++ program to sort an array in ascending order 
Cpp :: c++ create multidimensional vector 
Cpp :: initialize an array in c++ 
Cpp :: C++ cin cout 
Cpp :: sort a 2d vector c++ stl 
Cpp :: size of array 
Cpp :: how to dynamically allocate an array c++ 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =