Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
cin, cout recognized with <stdio.h>, not with <stdio>
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="mystic_fm" data-source="post: 796667" data-attributes="member: 28538"><p>Actually, in C++, <strong>#include <iostream></strong> is the recommended method.</p><p></p><p>To the original poster, I suspect your problem is that when you include <iostream>, cin is in the std namespace and you may not be using that namespace (whereas iostream.h does the latter for you). If you either use <strong>std::cin.getline(...)</strong> or add the line <strong>using std::cin</strong> or the line <strong>using namespace std</strong>, or in some other way use the namespace "std" to find "cin", the <iostream> version will probably compile and work for you.</p></blockquote><p></p>
[QUOTE="mystic_fm, post: 796667, member: 28538"] Actually, in C++, [B]#include <iostream>[/B] is the recommended method. To the original poster, I suspect your problem is that when you include <iostream>, cin is in the std namespace and you may not be using that namespace (whereas iostream.h does the latter for you). If you either use [B]std::cin.getline(...)[/B] or add the line [B]using std::cin[/B] or the line [B]using namespace std[/B], or in some other way use the namespace "std" to find "cin", the <iostream> version will probably compile and work for you. [/QUOTE]
Verification
Name this item 🌈
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
cin, cout recognized with <stdio.h>, not with <stdio>
Top