* Mac OS X/Emacs/C mode/compiling & executing programs
@ 2006-11-26 23:48 Frank Murray
2006-11-27 6:43 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Frank Murray @ 2006-11-26 23:48 UTC (permalink / raw)
[-- Attachment #1.1: Type: text/plain, Size: 916 bytes --]
Hello,
This is a new post and this is also a newbie question. I am trying
to Run a C program in the Emacs editor. It compiles, but unfortunately,
it does not Run or Execute. Sample code is listed directly below:
printf("Enter an x-value.\n");
scanf("%f", &x);
printf("Enter a y-value.\n");
scanf("%f", &y);
Within the Emacs editor, the above listed code does not Run; it
compiles,
but does not Run or execute.
What is really confusing is that within the Mac OS X terminal window,
it both
compiles and Runs. It seems as though within the Emacs editor, the
scanf
function does not work.
For example, if you type in the number "6" after the printf prompt,
and then scanf
takes in the value for "x" say, a debug printf statement spits out
the x-value as 0.
So, I'm guessing I'm not including a specific library or runtime
engine, I'm not sure.
Any information is appreciated. Thanks.
fjm
[-- Attachment #1.2: Type: text/html, Size: 2134 bytes --]
[-- Attachment #2: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Mac OS X/Emacs/C mode/compiling & executing programs
2006-11-26 23:48 Mac OS X/Emacs/C mode/compiling & executing programs Frank Murray
@ 2006-11-27 6:43 ` Eli Zaretskii
[not found] ` <E05CDE2A-010F-1000-DCD3-33BD3F4ABCAB-Webmail-10006@mac.com>
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2006-11-27 6:43 UTC (permalink / raw)
> From: Frank Murray <fjmurray1@mac.com>
> Date: Sun, 26 Nov 2006 18:48:59 -0500
>
> This is a new post and this is also a newbie question. I am trying
> to Run a C program in the Emacs editor. It compiles, but unfortunately,
> it does not Run or Execute. Sample code is listed directly below:
>
> printf("Enter an x-value.\n");
> scanf("%f", &x);
>
> printf("Enter a y-value.\n");
> scanf("%f", &y);
>
> Within the Emacs editor, the above listed code does not Run; it
> compiles, but does not Run or execute.
>
> What is really confusing is that within the Mac OS X terminal
> window, it both compiles and Runs. It seems as though within the
> Emacs editor, the scanf function does not work.
How did you run the program from within Emacs? There are several
different ways of running programs in Emacs, some of them are
unsuitable for programs that read from standard input (which is what
scanf does).
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Mac OS X/Emacs/C mode/compiling & executing programs
[not found] ` <E05CDE2A-010F-1000-DCD3-33BD3F4ABCAB-Webmail-10006@mac.com>
@ 2006-11-28 4:26 ` Eli Zaretskii
0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2006-11-28 4:26 UTC (permalink / raw)
> Date: Mon, 27 Nov 2006 17:31:35 -0800
> From: fjm <fjmurray1@mac.com>
>
> Yes, it is definitely not working; that much I do know.
> After it compiles, I select "Tools" from the Menu Bar,
> then I select "Tools" again, then select "Shell Command" which
> I'm guessing under a Unix environment is "./"
Shell Command is precisely a method that is not meant for interactive
programs. You should use "M-x shell" or maybe "M-x term".
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-11-28 4:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-26 23:48 Mac OS X/Emacs/C mode/compiling & executing programs Frank Murray
2006-11-27 6:43 ` Eli Zaretskii
[not found] ` <E05CDE2A-010F-1000-DCD3-33BD3F4ABCAB-Webmail-10006@mac.com>
2006-11-28 4:26 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.