unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* new post/Emacs v21.2/C++ mode/cin, cout
@ 2007-07-26 21:24 Frank Murray
  2007-07-27 10:32 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Murray @ 2007-07-26 21:24 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

    A new post, and not sure if this is more a basic C++ question than
an Emacs question.

I notice that in my Emacs editor, I cannot write just "cin >>" as  
input or "cout <<"
as output.  The g++ compiler used in Emacs requires "std::cin >>" and/ 
or "std::cout <<"
for input and output.  Note, this is a Terminal window running under  
Mac OS X.

So, again, if this is more a C++ question, I apologize in advance.   
If so, I will ask that community
this question.  If not, any information is appreciated.  Thanks.

fjm

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: new post/Emacs v21.2/C++ mode/cin, cout
       [not found] <mailman.4043.1185485073.32220.help-gnu-emacs@gnu.org>
@ 2007-07-26 23:07 ` weber
  2007-07-27  1:12   ` ryofurue
  0 siblings, 1 reply; 4+ messages in thread
From: weber @ 2007-07-26 23:07 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 26, 5:24 pm, Frank Murray <fjmurr...@mac.com> wrote:
> Hello,
>
>     A new post, and not sure if this is more a basic C++ question than
> an Emacs question.
>
> I notice that in my Emacs editor, I cannot write just "cin >>" as
> input or "cout <<"
> as output.  The g++ compiler used in Emacs requires "std::cin >>" and/
> or "std::cout <<"
> for input and output.  Note, this is a Terminal window running under
> Mac OS X.
>
> So, again, if this is more a C++ question, I apologize in advance.
> If so, I will ask that community
> this question.  If not, any information is appreciated.  Thanks.
>
> fjm

This has absolutely nothing to do with emacs.

On the other this piece of code:

// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}

compiles fine with g++ hello.cpp -o hello
so I don't get you.

-weber

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: new post/Emacs v21.2/C++ mode/cin, cout
  2007-07-26 23:07 ` new post/Emacs v21.2/C++ mode/cin, cout weber
@ 2007-07-27  1:12   ` ryofurue
  0 siblings, 0 replies; 4+ messages in thread
From: ryofurue @ 2007-07-27  1:12 UTC (permalink / raw)
  To: help-gnu-emacs

On Jul 26, 1:07 pm, weber <hug...@gmail.com> wrote:
[. . .]
> This has absolutely nothing to do with emacs.
>
> On the other this piece of code:
>
> // my first program in C++
>
> #include <iostream>
> using namespace std;
>
> int main ()
> {
>   cout << "Hello World!";
>   return 0;
>
> }
>
> compiles fine with g++ hello.cpp -o hello

I guess that the original poster didn't have

      using namespace std;

In that case, an ANSI-C++ compiler should require
std::cout  .

Ryo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: new post/Emacs v21.2/C++ mode/cin, cout
  2007-07-26 21:24 Frank Murray
@ 2007-07-27 10:32 ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2007-07-27 10:32 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Frank Murray <fjmurray1@mac.com>
> Date: Thu, 26 Jul 2007 17:24:28 -0400
> 
> I notice that in my Emacs editor, I cannot write just "cin >>" as
> input or "cout <<" as output.  The g++ compiler used in Emacs
> requires "std::cin >>" and/ or "std::cout <<" for input and output.

There's no such thing as the ``g++ compiler used in Emacs''.  Emacs
just invokes the compiler installed on your system.

So this problem is about g++ usage, not about Emacs.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-27 10:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.4043.1185485073.32220.help-gnu-emacs@gnu.org>
2007-07-26 23:07 ` new post/Emacs v21.2/C++ mode/cin, cout weber
2007-07-27  1:12   ` ryofurue
2007-07-26 21:24 Frank Murray
2007-07-27 10:32 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).