Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how to input a file path in c++

int main()
{
    std::cout << "Please enter the file name: ";
    std::string name;
    std::getline (std::cin, name);
    ifstream ifs(name.c_str());
    if (!ifs) error("can't open input file ", name);

    vector < Point > points;
    Point p;
    while (ifs >> p) points.push_back(p);
    // ....
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: Check if two stacks are the same using C++ 
Cpp :: object as a function argument and returning object 
Cpp :: tic tac toe in cpp 
Cpp :: how to make a goto area in c++ 
Cpp :: converter python to c++ code 
Cpp :: Marin and Anti-coprime Permutation codeforces solution in c++ 
Cpp :: three-way comparison c++ 
Cpp :: pointeur cpp 
Cpp :: c++ login 
Cpp :: FINAL CODES_MY_OS_LAB 
Cpp :: how to write string in c++ 
Cpp :: c++ install 
Cpp :: c++ remove last element from array 
Cpp :: concatenate 2 vectors in c++ 
Cpp :: c++ permutation 
Cpp :: assignment operators 
Cpp :: can derived class access private members 
Cpp :: how to get part from the vector cpp 
Cpp :: c++ excel cell blank cells 
C :: what is meaning of product *= in c 
C :: factorial c program using for loop 
C :: how to map one value to another in C 
C :: c print size_t 
C :: windeployqt example 
C :: input in c 
C :: how to print a file c 
C :: read from a file c 
C :: check if string in string c 
C :: c strcat 
C :: Firebase Connecting with ESP8266 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =