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
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
>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>.