C
C
Conan_Doyle2018-12-02 11:37:44
C++ / C#
Conan_Doyle, 2018-12-02 11:37:44

How to write to string using ifstream a string in Visual Studio compiler?

Cat:

ifstream in("input.txt");
string s;
in >> s;

In Code::Blocks this code works, but Visual Studio doesn't(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniel Demidko, 2018-12-02
@Conan_Doyle

Add at the beginning of your code: And everything will work)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question