Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting Started...

0 views
Skip to first unread message

Michael Rindt

unread,
Jul 26, 2001, 5:41:46 PM7/26/01
to
OK, I´m a newbie. I just want to know how to write C/C++ in Emacs.I just
need the "Hello" programm, I´ll find my way from there...and before you
say it the Manual doesn´t seem to explain this.

Kai Großjohann

unread,
Jul 26, 2001, 6:03:01 PM7/26/01
to

No, no, that's not the way it works. I could give you a hello
program, but I'm sure it won't help you. To prove:

#include <stdio.h>

int main (int argc, char** argv)
{
printf("Hello, world.\n");
}

There. That's the program. Does it help you? I thought so :-)

So. What do you want to do, what do you want to know?

kai
--
~/.signature: No such file or directory

Edward O'Connor

unread,
Jul 26, 2001, 6:06:14 PM7/26/01
to
> OK, I'm a newbie. I just want to know how to write C/C++ in Emacs.I
> just need the "Hello" programm, I'll find my way from there...and
> before you say it the Manual doesn't seem to explain this.

C-x C-f h e l l o . c RET # i n c l u d e SPC < s t d i o . h > RET
RET i n t SPC m a i n ( i n t SPC a r g c , SPC c h a r SPC * a r g v
[ ] ) RET { RET TAB p r i n t f ( " h e l l o , SPC w o r l d \ n " )
; RET } RET C-x C-s

HTH.


Ted

--
Edward O'Connor
t...@oconnor.cx

those who know me have no need of my name

unread,
Jul 26, 2001, 6:50:35 PM7/26/01
to
<3B608E9A...@netscape.net> divulged:

>OK, I惴 a newbie. I just want to know how to write C/C++ in Emacs.I just
>need the "Hello" programm, I惻l find my way from there...and before you
>say it the Manual doesn愒 seem to explain this.

just type. really, that's all there is to it. (i hope you don't think
that emacs will teach you c or c++ -- it won't.)

for example ...

,----[ type the following ]
| \c-x \c-f hello.cc
| #include <iostream>
| int main()
| {
| std::cout << "Hello, world!\n";
| }
| \c-x \c-s \m-x compile <ret> hello
| \m-! ./hello
`----

you've just created, compiled and run a c++ program. (the compile output
will appear in a window, and the program output will appear in the echo
area.) emacs will take care of indenting the program so it will appear
something like:

,----[ hello.cc ]
| #include <iostream>
| int main()
| {
| std::cout << "Hello, world!\n";
| }
`----

--
warning: i hate typing uppercase, mostly because i don't like seeing too much
of it, and will do my utmost to avoid it. hence where the emacs norm is to
use M-, \M-, C-, \C-, RET, SPC, i use \m-, \m-, \c-, \c-, <ret>, and <spc>.

0 new messages